Add support for spec:integration to ignore MRI and Java cases off their respective platforms

This commit is contained in:
R. Tyler Croy 2014-10-30 09:47:11 -07:00 committed by jway
parent 75efcc932e
commit fea0656bc2
1 changed files with 8 additions and 4 deletions

View File

@ -11,21 +11,25 @@ Rake::ExtensionTask.new do |t|
t.gem_spec = Gem::Specification.load('hermann.gemspec') t.gem_spec = Gem::Specification.load('hermann.gemspec')
end end
RSpec::Core::RakeTask.new(:spec) do |r| def add_rspec_options(options)
options = ['--tag ~type:integration']
if RUBY_PLATFORM == 'java' if RUBY_PLATFORM == 'java'
options << '--tag ~platform:mri' options << '--tag ~platform:mri'
else else
options << '--tag ~platform:java' options << '--tag ~platform:java'
end end
return options
end
RSpec::Core::RakeTask.new(:spec) do |r|
options = add_rspec_options(['--tag ~type:integration'])
r.rspec_opts = options.join(' ') r.rspec_opts = options.join(' ')
end end
namespace :spec do namespace :spec do
RSpec::Core::RakeTask.new(:integration) do |r| RSpec::Core::RakeTask.new(:integration) do |r|
r.rspec_opts = '--tag type:integration' options = add_rspec_options(['--tag type:integration'])
r.rspec_opts = options.join(' ')
end end
end end