Skip to content

Commit

Permalink
replace CommandLine with Runner for RSpec 3.0.0.rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
Brad Carson committed May 24, 2014
1 parent a94412c commit 38c79dc
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

1 comment on commit 38c79dc

@henrik
Copy link

@henrik henrik commented on 38c79dc Jun 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sporkrb Would be nice if this also applied to Rspec 2.99. Happy to make a PR, but I'm getting the impression that PRs aren't being accepted. If they are, please let me know!

Please sign in to comment.