summaryrefslogtreecommitdiff
path: root/spec/ruby/library/stringscanner
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/stringscanner')
-rw-r--r--spec/ruby/library/stringscanner/clear_spec.rb6
-rw-r--r--spec/ruby/library/stringscanner/empty_spec.rb6
-rw-r--r--spec/ruby/library/stringscanner/getbyte_spec.rb6
-rw-r--r--spec/ruby/library/stringscanner/peep_spec.rb6
-rw-r--r--spec/ruby/library/stringscanner/restsize_spec.rb6
5 files changed, 10 insertions, 20 deletions
diff --git a/spec/ruby/library/stringscanner/clear_spec.rb b/spec/ruby/library/stringscanner/clear_spec.rb
index 70c60f7039..c8b19abe7d 100644
--- a/spec/ruby/library/stringscanner/clear_spec.rb
+++ b/spec/ruby/library/stringscanner/clear_spec.rb
@@ -8,13 +8,11 @@ describe "StringScanner#clear" do
it "warns in verbose mode that the method is obsolete" do
s = StringScanner.new("abc")
lambda {
- $VERBOSE = true
s.clear
- }.should complain(/clear.*obsolete.*terminate/)
+ }.should complain(/clear.*obsolete.*terminate/, verbose: true)
lambda {
- $VERBOSE = false
s.clear
- }.should_not complain
+ }.should_not complain(verbose: false)
end
end
diff --git a/spec/ruby/library/stringscanner/empty_spec.rb b/spec/ruby/library/stringscanner/empty_spec.rb
index bba51364c8..0b67d23246 100644
--- a/spec/ruby/library/stringscanner/empty_spec.rb
+++ b/spec/ruby/library/stringscanner/empty_spec.rb
@@ -8,13 +8,11 @@ describe "StringScanner#empty?" do
it "warns in verbose mode that the method is obsolete" do
s = StringScanner.new("abc")
lambda {
- $VERBOSE = true
s.empty?
- }.should complain(/empty?.*obsolete.*eos?/)
+ }.should complain(/empty?.*obsolete.*eos?/, verbose: true)
lambda {
- $VERBOSE = false
s.empty?
- }.should_not complain
+ }.should_not complain(verbose: false)
end
end
diff --git a/spec/ruby/library/stringscanner/getbyte_spec.rb b/spec/ruby/library/stringscanner/getbyte_spec.rb
index a71c5ee781..102aa5325d 100644
--- a/spec/ruby/library/stringscanner/getbyte_spec.rb
+++ b/spec/ruby/library/stringscanner/getbyte_spec.rb
@@ -9,14 +9,12 @@ describe "StringScanner#getbyte" do
it "warns in verbose mode that the method is obsolete" do
s = StringScanner.new("abc")
lambda {
- $VERBOSE = true
s.getbyte
- }.should complain(/getbyte.*obsolete.*get_byte/)
+ }.should complain(/getbyte.*obsolete.*get_byte/, verbose: true)
lambda {
- $VERBOSE = false
s.getbyte
- }.should_not complain
+ }.should_not complain(verbose: false)
end
it_behaves_like :extract_range, :getbyte
diff --git a/spec/ruby/library/stringscanner/peep_spec.rb b/spec/ruby/library/stringscanner/peep_spec.rb
index 887522a8ae..a1c8565579 100644
--- a/spec/ruby/library/stringscanner/peep_spec.rb
+++ b/spec/ruby/library/stringscanner/peep_spec.rb
@@ -8,13 +8,11 @@ describe "StringScanner#peep" do
it "warns in verbose mode that the method is obsolete" do
s = StringScanner.new("abc")
lambda {
- $VERBOSE = true
s.peep(1)
- }.should complain(/peep.*obsolete.*peek/)
+ }.should complain(/peep.*obsolete.*peek/, verbose: true)
lambda {
- $VERBOSE = false
s.peep(1)
- }.should_not complain
+ }.should_not complain(verbose: false)
end
end
diff --git a/spec/ruby/library/stringscanner/restsize_spec.rb b/spec/ruby/library/stringscanner/restsize_spec.rb
index 87edf35ad6..cf3e22f34c 100644
--- a/spec/ruby/library/stringscanner/restsize_spec.rb
+++ b/spec/ruby/library/stringscanner/restsize_spec.rb
@@ -8,13 +8,11 @@ describe "StringScanner#restsize" do
it "warns in verbose mode that the method is obsolete" do
s = StringScanner.new("abc")
lambda {
- $VERBOSE = true
s.restsize
- }.should complain(/restsize.*obsolete.*rest_size/)
+ }.should complain(/restsize.*obsolete.*rest_size/, verbose: true)
lambda {
- $VERBOSE = false
s.restsize
- }.should_not complain
+ }.should_not complain(verbose: false)
end
end