Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

clean up spec_helper

  • Loading branch information...
commit 90209e1f9057965faca836a339cee9dc3654dffa 1 parent efc8168
@dchelimsky dchelimsky authored
View
2  spec/rspec/matchers/operator_matcher_spec.rb
@@ -21,7 +21,7 @@
end
-describe "unsupported operators", :ruby => '1.9' do
+describe "unsupported operators", :unless => RUBY_VERSION.to_f == 1.9 do
it "raises an appropriate error for should != expected" do
expect {
"apple".should != "pear"
View
46 spec/spec_helper.rb
@@ -15,54 +15,10 @@ def add_to_load_path(path, prepend=false)
require 'rspec/core'
require 'rspec/mocks'
-Dir['./spec/support/**/*'].each do |f|
- require f
-end
-
-RSpec::Matchers.define :include_method do |expected|
- match do |actual|
- actual.map { |m| m.to_s }.include?(expected.to_s)
- end
-end
-
-module RSpec
- module Ruby
- class << self
- def version
- RUBY_VERSION
- end
- end
- end
-end
-
-module RSpec
- module Matchers
- def fail
- raise_error(RSpec::Expectations::ExpectationNotMetError)
- end
-
- def fail_with(message)
- raise_error(RSpec::Expectations::ExpectationNotMetError, message)
- end
- end
-end
+Dir['./spec/support/**/*'].each {|f| require f}
RSpec::configure do |config|
- config.mock_with(:rspec)
- config.include RSpec::Mocks::Methods
config.color_enabled = true
config.filter_run :focused => true
-
- config.filter_run_excluding :ruby => lambda {|version|
- case version.to_s
- when "!jruby"
- RUBY_ENGINE != "jruby"
- when /^> (.*)/
- !(RUBY_VERSION.to_s > $1)
- else
- !(RUBY_VERSION.to_s =~ /^#{version.to_s}/)
- end
- }
-
config.run_all_when_everything_filtered = true
end
View
2  spec/support/classes.rb
@@ -1,4 +1,4 @@
-# This file contains various classes used by the specs.
+# various classes used by the specs
module RSpec
module Expectations
module Helper
View
18 spec/support/matchers.rb
@@ -0,0 +1,18 @@
+RSpec::Matchers.define :include_method do |expected|
+ match do |actual|
+ actual.map { |m| m.to_s }.include?(expected.to_s)
+ end
+end
+
+module RSpec
+ module Matchers
+ def fail
+ raise_error(RSpec::Expectations::ExpectationNotMetError)
+ end
+
+ def fail_with(message)
+ raise_error(RSpec::Expectations::ExpectationNotMetError, message)
+ end
+ end
+end
+
View
10 spec/support/ruby_version.rb
@@ -0,0 +1,10 @@
+module RSpec
+ module Ruby
+ class << self
+ def version
+ RUBY_VERSION
+ end
+ end
+ end
+end
+
Please sign in to comment.
Something went wrong with that request. Please try again.