Add rspec to the project for testing basic Hermann functionality

This commit is contained in:
R. Tyler Croy 2014-08-28 16:13:12 -07:00
parent d51050c3a6
commit fbdf9b6055
5 changed files with 54 additions and 2 deletions

6
.gitignore vendored
View File

@ -1 +1,7 @@
hermann.iml
.ruby-*
ext/*.so
ext/*.o
ext/mkmf.log
*.sw*
ext/Makefile

View File

@ -1,4 +1,9 @@
# A sample Gemfile
source "https://rubygems.org"
gem 'rake'
gem 'rake'
group :test do
gem 'rspec', '~> 3.0.0'
gem 'rspec-its'
end

28
Gemfile.lock Normal file
View File

@ -0,0 +1,28 @@
GEM
remote: https://rubygems.org/
specs:
diff-lcs (1.2.5)
rake (10.3.2)
rspec (3.0.0)
rspec-core (~> 3.0.0)
rspec-expectations (~> 3.0.0)
rspec-mocks (~> 3.0.0)
rspec-core (3.0.4)
rspec-support (~> 3.0.0)
rspec-expectations (3.0.4)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.0.0)
rspec-its (1.0.1)
rspec-core (>= 2.99.0.beta1)
rspec-expectations (>= 2.99.0.beta1)
rspec-mocks (3.0.4)
rspec-support (~> 3.0.0)
rspec-support (3.0.4)
PLATFORMS
ruby
DEPENDENCIES
rake
rspec (~> 3.0.0)
rspec-its

View File

@ -1,5 +1,7 @@
require 'rubygems'
require 'rake/clean'
require 'rspec/core/rake_task'
EXT_CONF = "ext/extconf.rb"
MAKEFILE = 'ext/Makefile'
@ -28,4 +30,6 @@ file MODULE => SRC do |t|
end
desc "Build the native library"
task :build => MODULE
task :build => MODULE
RSpec::Core::RakeTask.new(:spec)

9
spec/spec_helper.rb Normal file
View File

@ -0,0 +1,9 @@
require 'rubygems'
# Add ext/ to the load path so we can load `hermann_lib`
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/../ext/'))
require 'hermann'
RSpec.configure do |c|
end