Permalink
Browse files

Runner doesn't need to take Suite as argument

  • Loading branch information...
1 parent 2cd7a1b commit b6965c150423f6f9e862633a84d6e9973ac855c3 Jonas Nicklas and Kim Burgestrand committed Nov 2, 2011
Showing with 8 additions and 5 deletions.
  1. +5 −2 lib/evergreen/runner.rb
  2. +1 −1 lib/evergreen/tasks.rb
  3. +1 −1 spec/runner_spec.rb
  4. +1 −1 spec/spec_helper.rb
@@ -87,8 +87,7 @@ def failure_messages
attr_reader :suite, :io
- def initialize(suite, io=STDOUT)
- @suite = suite
+ def initialize(io=STDOUT)
@io = io
end
@@ -139,6 +138,10 @@ def session
@session ||= Capybara::Session.new(Evergreen.driver, Evergreen.application)
end
+ def suite
+ @suite ||= Evergreen::Suite.new
+ end
+
protected
def spec_runners
@@ -4,7 +4,7 @@
namespace :spec do
desc "Run JavaScript specs via Evergreen"
task :javascripts => :environment do
- result = Evergreen::Suite.new.run
+ result = Evergreen::Runner.new.run
Kernel.exit(1) unless result
end
end
View
@@ -2,7 +2,7 @@
describe Evergreen::Runner do
let(:suite) { Evergreen::Suite.new }
- let(:runner) { Evergreen::Runner.new(suite, buffer) }
+ let(:runner) { Evergreen::Runner.new(buffer) }
let(:buffer) { StringIO.new }
describe '#run' do
View
@@ -20,7 +20,7 @@ module EvergreenMatchers
class PassSpec # :nodoc:
def matches?(actual)
@actual = actual
- @runner = Evergreen::Runner.new(actual.suite, StringIO.new).spec_runner(@actual)
+ @runner = Evergreen::Runner.new(StringIO.new).spec_runner(@actual)
@runner.passed?
end

0 comments on commit b6965c1

Please sign in to comment.