We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5436339 commit aff25a1Copy full SHA for aff25a1
library/stringscanner/rest_spec.rb
@@ -25,3 +25,24 @@
25
it_behaves_like :extract_range_matched, :rest
26
27
end
28
+
29
+describe "StringScanner#rest?" do
30
+ before :each do
31
+ @s = StringScanner.new("This is a test")
32
+ end
33
34
+ it "returns true if there is more data in the string" do
35
+ @s.rest?.should be_true
36
+ @s.scan(/This/)
37
38
39
40
+ it "returns false if there is no more data in the string" do
41
+ @s.terminate
42
+ @s.rest?.should be_false
43
44
45
+ it "is the opposite of eos?" do
46
+ @s.rest?.should_not == @s.eos?
47
48
+end
0 commit comments