Permalink
Browse files

not much value from spork in this case (lots of value w/ rspec-rails …

…though)
  • Loading branch information...
1 parent ea08d2e commit 28d492dd0f81df2410cb5898c4d91bfd7ccdee03 @dchelimsky dchelimsky committed Jun 19, 2010
Showing with 50 additions and 57 deletions.
  1. +50 −57 spec/spec_helper.rb
View
@@ -1,77 +1,70 @@
require 'rubygems'
-require 'spork'
-Spork.prefork do
- $LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
- require 'rspec/core'
+$LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
+require 'rspec/core'
- $LOAD_PATH << File.expand_path('../../../rspec-expectations/lib', __FILE__)
- $LOAD_PATH << File.expand_path('../../../rspec-mocks/lib', __FILE__)
- require 'rspec/expectations'
- require 'rspec/mocks'
+$LOAD_PATH << File.expand_path('../../../rspec-expectations/lib', __FILE__)
+$LOAD_PATH << File.expand_path('../../../rspec-mocks/lib', __FILE__)
+require 'rspec/expectations'
+require 'rspec/mocks'
- begin
- require 'autotest'
- rescue LoadError
- raise "Could not load autotest."
- end
+begin
+ require 'autotest'
+rescue LoadError
+ raise "Could not load autotest."
+end
- require 'autotest/rspec2'
+require 'autotest/rspec2'
- Dir['./spec/support/**/*.rb'].map {|f| require f}
+Dir['./spec/support/**/*.rb'].map {|f| require f}
- module RSpec
- module Core
- module Matchers
- def fail
- raise_error(::RSpec::Expectations::ExpectationNotMetError)
- end
+module RSpec
+ module Core
+ module Matchers
+ def fail
+ raise_error(::RSpec::Expectations::ExpectationNotMetError)
+ end
- def fail_with(message)
- raise_error(::RSpec::Expectations::ExpectationNotMetError, message)
- end
+ def fail_with(message)
+ raise_error(::RSpec::Expectations::ExpectationNotMetError, message)
end
end
end
+end
- class NullObject
- def method_missing(method, *args, &block)
- # ignore
- end
+class NullObject
+ def method_missing(method, *args, &block)
+ # ignore
end
+end
- class RSpec::Core::ExampleGroup
- def self.run_all(reporter=nil)
- run(reporter || NullObject.new)
- end
+class RSpec::Core::ExampleGroup
+ def self.run_all(reporter=nil)
+ run(reporter || NullObject.new)
end
+end
- def in_editor?
- ENV.has_key?('TM_MODE') || ENV.has_key?('EMACS') || ENV.has_key?('VIM')
- end
+def in_editor?
+ ENV.has_key?('TM_MODE') || ENV.has_key?('EMACS') || ENV.has_key?('VIM')
+end
- RSpec.configure do |c|
- c.color_enabled = !in_editor?
- c.filter_run :focus => true
- c.run_all_when_everything_filtered = true
- c.filter_run_excluding :ruby => lambda {|version|
- case version.to_s
- when "!ruby"
- RUBY_ENGINE != "jruby"
- else
- !(RUBY_VERSION.to_s =~ /^#{version.to_s}/)
- end
- }
- c.before(:each) do
- @real_world = RSpec.world
- RSpec.instance_variable_set(:@world, RSpec::Core::World.new)
- end
- c.after(:each) do
- RSpec.instance_variable_set(:@world, @real_world)
+RSpec.configure do |c|
+ c.color_enabled = !in_editor?
+ c.filter_run :focus => true
+ c.run_all_when_everything_filtered = true
+ c.filter_run_excluding :ruby => lambda {|version|
+ case version.to_s
+ when "!ruby"
+ RUBY_ENGINE != "jruby"
+ else
+ !(RUBY_VERSION.to_s =~ /^#{version.to_s}/)
end
+ }
+ c.before(:each) do
+ @real_world = RSpec.world
+ RSpec.instance_variable_set(:@world, RSpec::Core::World.new)
+ end
+ c.after(:each) do
+ RSpec.instance_variable_set(:@world, @real_world)
end
end
-
-Spork.each_run do
-end
-

0 comments on commit 28d492d

Please sign in to comment.