From 8400cfdc151382c2f33574d1ea8aeeab6456ea91 Mon Sep 17 00:00:00 2001 From: "R. Tyler Croy" Date: Thu, 30 Oct 2014 09:47:11 -0700 Subject: [PATCH] Add support for spec:integration to ignore MRI and Java cases off their respective platforms --- Rakefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Rakefile b/Rakefile index 4b8c0d2..49bf20c 100644 --- a/Rakefile +++ b/Rakefile @@ -11,21 +11,25 @@ Rake::ExtensionTask.new do |t| t.gem_spec = Gem::Specification.load('hermann.gemspec') end -RSpec::Core::RakeTask.new(:spec) do |r| - options = ['--tag ~type:integration'] - +def add_rspec_options(options) if RUBY_PLATFORM == 'java' options << '--tag ~platform:mri' else options << '--tag ~platform:java' end + return options +end + +RSpec::Core::RakeTask.new(:spec) do |r| + options = add_rspec_options(['--tag ~type:integration']) r.rspec_opts = options.join(' ') end namespace :spec do 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