Skip to content

Commit

Permalink
fix replace CommandLine with Runner for RSpec 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hbda committed Oct 8, 2014
1 parent a94412c commit b247cde
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/spork/test_framework/rspec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'rspec/core/version'

class Spork::TestFramework::RSpec < Spork::TestFramework
DEFAULT_PORT = 8989
HELPER_FILE = File.join(Dir.pwd, "spec/spec_helper.rb")
Expand All @@ -7,11 +9,19 @@ def run_tests(argv, stderr, stdout)
::Spec::Runner::CommandLine.run(
::Spec::Runner::OptionParser.parse(argv, stderr, stdout)
)
elsif rspec3?
options = ::RSpec::Core::ConfigurationOptions.new(argv)
::RSpec::Core::Runner.new(options).run(stderr, stdout)
else
::RSpec::Core::CommandLine.new(argv).run(stderr, stdout)
end
end

def rspec3?
return false if !defined?(::RSpec::Core::Version::STRING)
::RSpec::Core::Version::STRING =~ /^3\./
end

def rspec1?
defined?(Spec) && !defined?(RSpec)
end
Expand Down

0 comments on commit b247cde

Please sign in to comment.