0
0
Fork 0

Create test infrastructure

This commit is contained in:
Stormwind 2015-05-01 08:09:40 +02:00
parent b9ecfcf3af
commit d592e315d8
3 changed files with 41 additions and 0 deletions

36
Rakefile Normal file
View File

@ -0,0 +1,36 @@
# encoding: utf-8
require 'rake'
FileList['tasks/**/*.rake'].each { |task| import task }
desc 'run all specs'
task :spec => ['spec:unit', 'spec:integration']
desc 'run all integration tests'
task :integration => ['spec:integration']
namespace :spec do
spec_defaults = lambda do |spec|
spec.rspec_opts = ['--options', 'spec/spec.opts']
end
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new('unit') do |task|
spec_defaults.call(task)
task.pattern = 'spec/unit/**/*_spec.rb'
end
RSpec::Core::RakeTask.new('integration') do |task|
spec_defaults.call(task)
task.pattern = 'spec/integration/**/*_spec.rb'
end
RSpec::Core::RakeTask.new('coverage') do |task|
spec_defaults.call(task)
task.pattern = 'spec/{unit,integration}/*_spec.rb'
end
end
task :default => :spec

3
spec/spec.opts Normal file
View File

@ -0,0 +1,3 @@
--color
--order random
--format d

View File

@ -7,3 +7,5 @@ if ENV['SIMPLECOV']
end
require 'rubella'
require 'rubella/storage'
require 'rubella/input/json'