Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: rspec/rspec-expectations
...
head fork: rspec/rspec-expectations
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
View
21 Gemfile-custom.sample
@@ -6,29 +6,14 @@ group :development do
gem 'spork', '0.9.0'
platform :mri do
- gem 'rb-fsevent', '~> 0.4.3.1'
+ gem 'rb-fsevent', '~> 0.9'
gem 'ruby-prof', '~> 0.10.0'
case RUBY_VERSION
when /^1.8/
gem 'ruby-debug'
- when '1.9.2'
- gem 'ruby-debug19', '0.11.6'
- gem 'ruby-debug-base19', '0.11.25'
- gem 'linecache19', '0.5.12'
- when '1.9.3'
- gem 'ruby-debug19', '0.11.6'
- # NOTE - as of 2012-03-17 the following two gems have not been released,
- # so if you see either of these errors when trying to install the bundle:
- #
- # Could not find gem 'ruby-debug-base19 (= 0.11.26) ruby' in the gems available on this machine.
- # Could not find gem 'linecache19 (= 0.5.13) ruby' in the gems available on this machine.
- #
- # ... run 'script/download-ruby-debug-19-dependencies' and try again
- #
- # See http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug for more info.
- gem 'ruby-debug-base19', '0.11.26'
- gem 'linecache19', '0.5.13'
+ when /^1.9/
+ gem 'debugger'
end
end
end
View
6 lib/rspec/matchers/built_in/eq.rb
@@ -14,9 +14,13 @@ def failure_message_for_should_not
"\nexpected: value != #{expected.inspect}\n got: #{actual.inspect}\n\n(compared using ==)\n"
end
+ def descriptions
+ { :positive => "eq #{expected.inspect}",
+ :negative => "does not eq #{expected.inspect}" }
+ end
+
def diffable?; true; end
end
end
end
end
-
View
11 lib/rspec/matchers/generated_descriptions.rb
@@ -10,11 +10,16 @@ def self.clear_generated_description
end
def self.generated_description
- return nil if last_should.nil?
- "#{last_should.to_s.gsub('_',' ')} #{last_description}"
+ if last_should.nil?
+ nil
+ elsif last_matcher.respond_to?(:descriptions)
+ last_matcher.descriptions[last_should =~ /not/ ? :negative : :positive]
+ else
+ "#{last_should.to_s.gsub('_',' ')} #{last_description}"
+ end
end
- private
+ private
def self.last_description
last_matcher.respond_to?(:description) ? last_matcher.description : <<-MESSAGE
View
4 spec/rspec/matchers/description_generation_spec.rb
@@ -7,12 +7,12 @@
it "should eq expected" do
"this".should eq "this"
- RSpec::Matchers.generated_description.should eq "should eq \"this\""
+ RSpec::Matchers.generated_description.should eq "eq \"this\""
end
it "should not eq expected" do
"this".should_not eq "that"
- RSpec::Matchers.generated_description.should eq "should not eq \"that\""
+ RSpec::Matchers.generated_description.should eq "does not eq \"that\""
end
it "should be empty (arbitrary predicate)" do

No commit comments for this range

Something went wrong with that request. Please try again.