mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-21 17:50:13 +01:00
Added Rspec and Webrat plugins and started porting Selenium on Rails tests to Rspec Plain Text Stories driving Webrat driving Selenium.
This commit is contained in:
parent
0600756bbf
commit
0f7d6f7a1d
602 changed files with 47788 additions and 29 deletions
43
vendor/plugins/rspec/lib/spec/matchers/equal.rb
vendored
Normal file
43
vendor/plugins/rspec/lib/spec/matchers/equal.rb
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
module Spec
|
||||
module Matchers
|
||||
|
||||
class Equal #:nodoc:
|
||||
def initialize(expected)
|
||||
@expected = expected
|
||||
end
|
||||
|
||||
def matches?(actual)
|
||||
@actual = actual
|
||||
@actual.equal?(@expected)
|
||||
end
|
||||
|
||||
def failure_message
|
||||
return "expected #{@expected.inspect}, got #{@actual.inspect} (using .equal?)", @expected, @actual
|
||||
end
|
||||
|
||||
def negative_failure_message
|
||||
return "expected #{@actual.inspect} not to equal #{@expected.inspect} (using .equal?)", @expected, @actual
|
||||
end
|
||||
|
||||
def description
|
||||
"equal #{@expected.inspect}"
|
||||
end
|
||||
end
|
||||
|
||||
# :call-seq:
|
||||
# should equal(expected)
|
||||
# should_not equal(expected)
|
||||
#
|
||||
# Passes if actual and expected are the same object (object identity).
|
||||
#
|
||||
# See http://www.ruby-doc.org/core/classes/Object.html#M001057 for more information about equality in Ruby.
|
||||
#
|
||||
# == Examples
|
||||
#
|
||||
# 5.should equal(5) #Fixnums are equal
|
||||
# "5".should_not equal("5") #Strings that look the same are not the same object
|
||||
def equal(expected)
|
||||
Matchers::Equal.new(expected)
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue