diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2007-12-05 13:26:16 +0100 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2007-12-05 13:26:16 +0100 |
commit | 878d917713d943981757f4986ee287aa63ef6b18 (patch) | |
tree | 15f020c22c62a338a283cdf02295ccfb8e2d9221 /lib | |
parent | 802468420c86f904e54d132d54a68189add5b220 (diff) | |
download | bacon-878d917713d943981757f4986ee287aa63ef6b18.tar.gz bacon-878d917713d943981757f4986ee287aa63ef6b18.tar.xz bacon-878d917713d943981757f4986ee287aa63ef6b18.zip |
Add identical_to/same_as
darcs-hash:20071205122616-4fc50-34f25320f27b4db25249d05e092ab2f87d9e40e7.gz
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bacon.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/bacon.rb b/lib/bacon.rb index 4e63422..9b320f2 100644 --- a/lib/bacon.rb +++ b/lib/bacon.rb @@ -270,7 +270,7 @@ class Should end def method_missing(name, *args, &block) - name = "#{name}?" if name.to_s =~ /\w/ + name = "#{name}?" if name.to_s =~ /\w[^?]\z/ desc = @negated ? "not " : "" desc << @object.inspect << "." << name.to_s @@ -283,4 +283,7 @@ class Should def equal(value); self == value; end def match(value); self =~ value; end + + def identical_to(value); self.equal? value; end + alias same_as identical_to end |