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
63
vendor/plugins/rspec/lib/spec/expectations/extensions/object.rb
vendored
Normal file
63
vendor/plugins/rspec/lib/spec/expectations/extensions/object.rb
vendored
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
module Spec
|
||||
module Expectations
|
||||
# rspec adds #should and #should_not to every Object (and,
|
||||
# implicitly, every Class).
|
||||
module ObjectExpectations
|
||||
# :call-seq:
|
||||
# should(matcher)
|
||||
# should == expected
|
||||
# should === expected
|
||||
# should =~ expected
|
||||
#
|
||||
# receiver.should(matcher)
|
||||
# => Passes if matcher.matches?(receiver)
|
||||
#
|
||||
# receiver.should == expected #any value
|
||||
# => Passes if (receiver == expected)
|
||||
#
|
||||
# receiver.should === expected #any value
|
||||
# => Passes if (receiver === expected)
|
||||
#
|
||||
# receiver.should =~ regexp
|
||||
# => Passes if (receiver =~ regexp)
|
||||
#
|
||||
# See Spec::Matchers for more information about matchers
|
||||
#
|
||||
# == Warning
|
||||
#
|
||||
# NOTE that this does NOT support receiver.should != expected.
|
||||
# Instead, use receiver.should_not == expected
|
||||
def should(matcher=:use_operator_matcher, &block)
|
||||
ExpectationMatcherHandler.handle_matcher(self, matcher, &block)
|
||||
end
|
||||
|
||||
# :call-seq:
|
||||
# should_not(matcher)
|
||||
# should_not == expected
|
||||
# should_not === expected
|
||||
# should_not =~ expected
|
||||
#
|
||||
# receiver.should_not(matcher)
|
||||
# => Passes unless matcher.matches?(receiver)
|
||||
#
|
||||
# receiver.should_not == expected
|
||||
# => Passes unless (receiver == expected)
|
||||
#
|
||||
# receiver.should_not === expected
|
||||
# => Passes unless (receiver === expected)
|
||||
#
|
||||
# receiver.should_not =~ regexp
|
||||
# => Passes unless (receiver =~ regexp)
|
||||
#
|
||||
# See Spec::Matchers for more information about matchers
|
||||
def should_not(matcher=:use_operator_matcher, &block)
|
||||
NegativeExpectationMatcherHandler.handle_matcher(self, matcher, &block)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class Object
|
||||
include Spec::Expectations::ObjectExpectations
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue