Browse files

make them all class methods

  • Loading branch information...
1 parent 9c22e9a commit dd5313270df3d4bb5962233833663226d773ac8f @dchelimsky dchelimsky committed Jun 2, 2010
Showing with 8 additions and 15 deletions.
  1. +4 −4 lib/rspec/core/runner.rb
  2. +1 −1 spec/rspec/core/resources/a_spec.rb
  3. +3 −8 spec/rspec/core/runner_spec.rb
  4. +0 −2 spec/spec_helper.rb
View
8 lib/rspec/core/runner.rb
@@ -11,27 +11,27 @@ def self.installed_at_exit?
def self.autorun
return if installed_at_exit? || running_in_drb?
@installed_at_exit = true
- at_exit { new.run(ARGV, $stderr, $stdout) ? exit(0) : exit(1) }
+ at_exit { run(ARGV, $stderr, $stdout) ? exit(0) : exit(1) }
end
def self.running_in_drb?
(DRb.current_server rescue false) &&
!!((DRb.current_server.uri) =~ /druby\:\/\/127.0.0.1\:/)
end
- def run(args, err, out)
+ def self.run(args, err, out)
if args.any? {|a| %w[--drb -X].include? a}
run_over_drb(args, err, out) || run_in_process(args, err, out)
else
run_in_process(args, err, out)
end
end
- def run_over_drb(args, err, out)
+ def self.run_over_drb(args, err, out)
DRbCommandLine.new(args).run(err, out)
end
- def run_in_process(args, err, out)
+ def self.run_in_process(args, err, out)
CommandLine.new(args).run(err, out)
end
View
2 spec/rspec/core/resources/a_spec.rb
@@ -1 +1 @@
-# Empty - used by ../options_spec.rb
+# Empty - used by ../options_spec.rb
View
11 spec/rspec/core/runner_spec.rb
@@ -24,31 +24,26 @@ module RSpec::Core
end
- # TODO move collaboration specs into this and cover the other situations
describe "#run" do
context "with --drb or -X" do
before(:each) do
- @err, @out = StringIO.new, StringIO.new
- @drb_port, @drb_argv = double(Fixnum), double(Array)
+ @err = @out = StringIO.new
- @non_drb_args = %w[--color --drb-port 8181]
-
@options = RSpec::Core::ConfigurationOptions.new(%w[--drb --drb-port 8181 --color])
RSpec::Core::ConfigurationOptions.stub(:new) { @options }
-
@drb_proxy = double(RSpec::Core::DRbCommandLine, :run => true)
RSpec::Core::DRbCommandLine.stub(:new => @drb_proxy)
end
it "builds a DRbCommandLine" do
RSpec::Core::DRbCommandLine.should_receive(:new)
- RSpec::Core::Runner.new.run(%w[ --drb ], @err, @out)
+ RSpec::Core::Runner.run(%w[ --drb ], @err, @out)
end
it "runs specs over the proxy" do
@drb_proxy.should_receive(:run).with(@err, @out)
- RSpec::Core::Runner.new.run(%w[ --drb ], @err, @out)
+ RSpec::Core::Runner.run(%w[ --drb ], @err, @out)
end
end
end
View
2 spec/spec_helper.rb
@@ -58,10 +58,8 @@ def in_editor?
RSpec.instance_variable_set(:@world, @real_world)
end
end
- puts "PREFORK"
end
Spork.each_run do
- puts "EACH RUN"
end

0 comments on commit dd53132

Please sign in to comment.