summaryrefslogtreecommitdiff
path: root/spec/ruby/core/argf/shared
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/argf/shared')
-rw-r--r--spec/ruby/core/argf/shared/each_byte.rb6
-rw-r--r--spec/ruby/core/argf/shared/each_char.rb6
-rw-r--r--spec/ruby/core/argf/shared/each_codepoint.rb8
-rw-r--r--spec/ruby/core/argf/shared/each_line.rb6
-rw-r--r--spec/ruby/core/argf/shared/eof.rb2
-rw-r--r--spec/ruby/core/argf/shared/fileno.rb2
-rw-r--r--spec/ruby/core/argf/shared/getc.rb2
-rw-r--r--spec/ruby/core/argf/shared/pos.rb2
-rw-r--r--spec/ruby/core/argf/shared/read.rb4
9 files changed, 19 insertions, 19 deletions
diff --git a/spec/ruby/core/argf/shared/each_byte.rb b/spec/ruby/core/argf/shared/each_byte.rb
index 6b1dc1dae2..48c9ae04f8 100644
--- a/spec/ruby/core/argf/shared/each_byte.rb
+++ b/spec/ruby/core/argf/shared/each_byte.rb
@@ -18,14 +18,14 @@ describe :argf_each_byte, shared: true do
it "returns self when passed a block" do
argf [@file1_name, @file2_name] do
- @argf.send(@method) {}.should equal(@argf)
+ @argf.send(@method) {}.should.equal?(@argf)
end
end
it "returns an Enumerator when passed no block" do
argf [@file1_name, @file2_name] do
enum = @argf.send(@method)
- enum.should be_an_instance_of(Enumerator)
+ enum.should.instance_of?(Enumerator)
bytes = []
enum.each { |b| bytes << b }
@@ -37,7 +37,7 @@ describe :argf_each_byte, shared: true do
it "returns an Enumerator" do
argf [@file1_name, @file2_name] do
enum = @argf.send(@method)
- enum.should be_an_instance_of(Enumerator)
+ enum.should.instance_of?(Enumerator)
bytes = []
enum.each { |b| bytes << b }
diff --git a/spec/ruby/core/argf/shared/each_char.rb b/spec/ruby/core/argf/shared/each_char.rb
index 9e333ecc5b..4b5e8452ab 100644
--- a/spec/ruby/core/argf/shared/each_char.rb
+++ b/spec/ruby/core/argf/shared/each_char.rb
@@ -18,14 +18,14 @@ describe :argf_each_char, shared: true do
it "returns self when passed a block" do
argf [@file1_name, @file2_name] do
- @argf.send(@method) {}.should equal(@argf)
+ @argf.send(@method) {}.should.equal?(@argf)
end
end
it "returns an Enumerator when passed no block" do
argf [@file1_name, @file2_name] do
enum = @argf.send(@method)
- enum.should be_an_instance_of(Enumerator)
+ enum.should.instance_of?(Enumerator)
chars = []
enum.each { |c| chars << c }
@@ -37,7 +37,7 @@ describe :argf_each_char, shared: true do
it "returns an Enumerator" do
argf [@file1_name, @file2_name] do
enum = @argf.send(@method)
- enum.should be_an_instance_of(Enumerator)
+ enum.should.instance_of?(Enumerator)
chars = []
enum.each { |c| chars << c }
diff --git a/spec/ruby/core/argf/shared/each_codepoint.rb b/spec/ruby/core/argf/shared/each_codepoint.rb
index e2a2dfff46..3137306ad5 100644
--- a/spec/ruby/core/argf/shared/each_codepoint.rb
+++ b/spec/ruby/core/argf/shared/each_codepoint.rb
@@ -10,7 +10,7 @@ describe :argf_each_codepoint, shared: true do
it "is a public method" do
argf @filenames do
- @argf.public_methods(false).should include(@method)
+ @argf.public_methods(false).should.include?(@method)
end
end
@@ -22,13 +22,13 @@ describe :argf_each_codepoint, shared: true do
it "returns self when passed a block" do
argf @filenames do
- @argf.send(@method) {}.should equal(@argf)
+ @argf.send(@method) {}.should.equal?(@argf)
end
end
it "returns an Enumerator when passed no block" do
argf @filenames do
- @argf.send(@method).should be_an_instance_of(Enumerator)
+ @argf.send(@method).should.instance_of?(Enumerator)
end
end
@@ -41,7 +41,7 @@ describe :argf_each_codepoint, shared: true do
describe "when no block is given" do
it "returns an Enumerator" do
argf @filenames do
- @argf.send(@method).should be_an_instance_of(Enumerator)
+ @argf.send(@method).should.instance_of?(Enumerator)
end
end
diff --git a/spec/ruby/core/argf/shared/each_line.rb b/spec/ruby/core/argf/shared/each_line.rb
index c0ef77dc54..7e66e38803 100644
--- a/spec/ruby/core/argf/shared/each_line.rb
+++ b/spec/ruby/core/argf/shared/each_line.rb
@@ -9,7 +9,7 @@ describe :argf_each_line, shared: true do
it "is a public method" do
argf [@file1_name, @file2_name] do
- @argf.public_methods(false).should include(@method)
+ @argf.public_methods(false).should.include?(@method)
end
end
@@ -29,7 +29,7 @@ describe :argf_each_line, shared: true do
it "returns self when passed a block" do
argf [@file1_name, @file2_name] do
- @argf.send(@method) {}.should equal(@argf)
+ @argf.send(@method) {}.should.equal?(@argf)
end
end
@@ -45,7 +45,7 @@ describe :argf_each_line, shared: true do
describe "when no block is given" do
it "returns an Enumerator" do
argf [@file1_name, @file2_name] do
- @argf.send(@method).should be_an_instance_of(Enumerator)
+ @argf.send(@method).should.instance_of?(Enumerator)
end
end
diff --git a/spec/ruby/core/argf/shared/eof.rb b/spec/ruby/core/argf/shared/eof.rb
index 0e684f943f..8b3897b952 100644
--- a/spec/ruby/core/argf/shared/eof.rb
+++ b/spec/ruby/core/argf/shared/eof.rb
@@ -18,7 +18,7 @@ describe :argf_eof, shared: true do
it "raises IOError when called on a closed stream" do
argf [@file1] do
@argf.read
- -> { @argf.send(@method) }.should raise_error(IOError)
+ -> { @argf.send(@method) }.should.raise(IOError)
end
end
end
diff --git a/spec/ruby/core/argf/shared/fileno.rb b/spec/ruby/core/argf/shared/fileno.rb
index 4350d43747..e605be46e3 100644
--- a/spec/ruby/core/argf/shared/fileno.rb
+++ b/spec/ruby/core/argf/shared/fileno.rb
@@ -18,7 +18,7 @@ describe :argf_fileno, shared: true do
it "raises an ArgumentError when called on a closed stream" do
argf [@file1] do
@argf.read
- -> { @argf.send(@method) }.should raise_error(ArgumentError)
+ -> { @argf.send(@method) }.should.raise(ArgumentError)
end
end
end
diff --git a/spec/ruby/core/argf/shared/getc.rb b/spec/ruby/core/argf/shared/getc.rb
index 8be39c60b6..d63372d9d7 100644
--- a/spec/ruby/core/argf/shared/getc.rb
+++ b/spec/ruby/core/argf/shared/getc.rb
@@ -9,7 +9,7 @@ describe :argf_getc, shared: true do
it "reads each char of files" do
argf [@file1, @file2] do
- chars = ""
+ chars = +""
@chars.size.times { chars << @argf.send(@method) }
chars.should == @chars
end
diff --git a/spec/ruby/core/argf/shared/pos.rb b/spec/ruby/core/argf/shared/pos.rb
index 9836d5f1e4..f859d3a29d 100644
--- a/spec/ruby/core/argf/shared/pos.rb
+++ b/spec/ruby/core/argf/shared/pos.rb
@@ -25,7 +25,7 @@ describe :argf_pos, shared: true do
it "raises an ArgumentError when called on a closed stream" do
argf [@file1] do
@argf.read
- -> { @argf.send(@method) }.should raise_error(ArgumentError)
+ -> { @argf.send(@method) }.should.raise(ArgumentError)
end
end
end
diff --git a/spec/ruby/core/argf/shared/read.rb b/spec/ruby/core/argf/shared/read.rb
index fe903983c0..e76d022139 100644
--- a/spec/ruby/core/argf/shared/read.rb
+++ b/spec/ruby/core/argf/shared/read.rb
@@ -15,7 +15,7 @@ describe :argf_read, shared: true do
it "treats second argument as an output buffer" do
argf [@file1_name] do
- buffer = ""
+ buffer = +""
@argf.send(@method, @file1.size, buffer)
buffer.should == @file1
end
@@ -23,7 +23,7 @@ describe :argf_read, shared: true do
it "clears output buffer before appending to it" do
argf [@file1_name] do
- buffer = "to be cleared"
+ buffer = +"to be cleared"
@argf.send(@method, @file1.size, buffer)
buffer.should == @file1
end