[macruby-changes] [2087] MacRuby/branches/experimental/spec/frozen/library/stringscanner/ shared/pos.rb
source_changes at macosforge.org
source_changes at macosforge.org
Sun Jul 26 02:26:03 PDT 2009
Revision: 2087
http://trac.macosforge.org/projects/ruby/changeset/2087
Author: mattaimonetti at gmail.com
Date: 2009-07-26 02:26:03 -0700 (Sun, 26 Jul 2009)
Log Message:
-----------
added more pos= specs to stringscanner checking on behaviors when negative values are being passed.
Modified Paths:
--------------
MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/pos.rb
Modified: MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/pos.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/pos.rb 2009-07-26 09:09:47 UTC (rev 2086)
+++ MacRuby/branches/experimental/spec/frozen/library/stringscanner/shared/pos.rb 2009-07-26 09:26:03 UTC (rev 2087)
@@ -33,6 +33,15 @@
@s.send(@method, 5)
@s.rest.should == "is a test"
end
+
+ it "modify the scan pointer with a negative value in range" do
+ @s.send(@method, -2)
+ @s.pos.should == 12
+ end
+
+ it "modify the scan pointer with a negative value out of range" do
+ lambda { @s.send(@method, -15) }.should raise_error(RangeError)
+ end
it "raises a RangeError when the passed argument is out of range" do
lambda { @s.send(@method, 20) }.should raise_error(RangeError)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090726/b85cbf4e/attachment.html>
More information about the macruby-changes
mailing list