1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2020-05-03 12:28:29 +02:00
parent f646d20aae
commit 5aaa75e7c1
263 changed files with 921 additions and 921 deletions

View file

@ -3,9 +3,9 @@ require_relative '../spec_helper'
describe "The error message caused by an exception" do describe "The error message caused by an exception" do
it "is not printed to stdout" do it "is not printed to stdout" do
out = ruby_exe("this_does_not_exist", args: "2> #{File::NULL}") out = ruby_exe("this_does_not_exist", args: "2> #{File::NULL}")
out.chomp.empty?.should == true out.chomp.should.empty?
out = ruby_exe("end #syntax error", args: "2> #{File::NULL}") out = ruby_exe("end #syntax error", args: "2> #{File::NULL}")
out.chomp.empty?.should == true out.chomp.should.empty?
end end
end end

View file

@ -34,7 +34,7 @@ describe "ARGF.binmode" do
it "sets the file's encoding to BINARY" do it "sets the file's encoding to BINARY" do
argf [@bin_file, @file1] do argf [@bin_file, @file1] do
@argf.binmode @argf.binmode
@argf.binmode?.should == true @argf.should.binmode?
@argf.gets.encoding.should == Encoding::BINARY @argf.gets.encoding.should == Encoding::BINARY
@argf.skip @argf.skip
@argf.read.encoding.should == Encoding::BINARY @argf.read.encoding.should == Encoding::BINARY

View file

@ -4,17 +4,17 @@ describe "Array#any?" do
describe 'with no block given (a default block of { |x| x } is implicit)' do describe 'with no block given (a default block of { |x| x } is implicit)' do
it "is false if the array is empty" do it "is false if the array is empty" do
empty_array = [] empty_array = []
empty_array.any?.should == false empty_array.should_not.any?
end end
it "is false if the array is not empty, but all the members of the array are falsy" do it "is false if the array is not empty, but all the members of the array are falsy" do
falsy_array = [false, nil, false] falsy_array = [false, nil, false]
falsy_array.any?.should == false falsy_array.should_not.any?
end end
it "is true if the array has any truthy members" do it "is true if the array has any truthy members" do
not_empty_array = ['anything', nil] not_empty_array = ['anything', nil]
not_empty_array.any?.should == true not_empty_array.should.any?
end end
end end

View file

@ -16,7 +16,7 @@ describe "Array#clear" do
it "leaves the Array empty" do it "leaves the Array empty" do
a = [1] a = [1]
a.clear a.clear
a.empty?.should == true a.should.empty?
a.size.should == 0 a.size.should == 0
end end

View file

@ -12,8 +12,8 @@ describe "Array#clone" do
aa = a.clone aa = a.clone
bb = b.clone bb = b.clone
aa.frozen?.should == true aa.should.frozen?
bb.frozen?.should == false bb.should_not.frozen?
end end
it "copies singleton methods" do it "copies singleton methods" do

View file

@ -3,8 +3,8 @@ require_relative 'fixtures/classes'
describe "Array#empty?" do describe "Array#empty?" do
it "returns true if the array has no elements" do it "returns true if the array has no elements" do
[].empty?.should == true [].should.empty?
[1].empty?.should == false [1].should_not.empty?
[1, 2].empty?.should == false [1, 2].should_not.empty?
end end
end end

View file

@ -4,13 +4,13 @@ require_relative 'fixtures/classes'
describe "Array#frozen?" do describe "Array#frozen?" do
it "returns true if array is frozen" do it "returns true if array is frozen" do
a = [1, 2, 3] a = [1, 2, 3]
a.frozen?.should == false a.should_not.frozen?
a.freeze a.freeze
a.frozen?.should == true a.should.frozen?
end end
it "returns false for an array being sorted by #sort" do it "returns false for an array being sorted by #sort" do
a = [1, 2, 3] a = [1, 2, 3]
a.sort { |x,y| a.frozen?.should == false; x <=> y } a.sort { |x,y| a.should_not.frozen?; x <=> y }
end end
end end

View file

@ -92,39 +92,39 @@ describe "Array#* with an integer" do
it "copies the taint status of the original array even if the passed count is 0" do it "copies the taint status of the original array even if the passed count is 0" do
ary = [1, 2, 3] ary = [1, 2, 3]
ary.taint ary.taint
(ary * 0).tainted?.should == true (ary * 0).should.tainted?
end end
it "copies the taint status of the original array even if the array is empty" do it "copies the taint status of the original array even if the array is empty" do
ary = [] ary = []
ary.taint ary.taint
(ary * 3).tainted?.should == true (ary * 3).should.tainted?
end end
it "copies the taint status of the original array if the passed count is not 0" do it "copies the taint status of the original array if the passed count is not 0" do
ary = [1, 2, 3] ary = [1, 2, 3]
ary.taint ary.taint
(ary * 1).tainted?.should == true (ary * 1).should.tainted?
(ary * 2).tainted?.should == true (ary * 2).should.tainted?
end end
it "copies the untrusted status of the original array even if the passed count is 0" do it "copies the untrusted status of the original array even if the passed count is 0" do
ary = [1, 2, 3] ary = [1, 2, 3]
ary.untrust ary.untrust
(ary * 0).untrusted?.should == true (ary * 0).should.untrusted?
end end
it "copies the untrusted status of the original array even if the array is empty" do it "copies the untrusted status of the original array even if the array is empty" do
ary = [] ary = []
ary.untrust ary.untrust
(ary * 3).untrusted?.should == true (ary * 3).should.untrusted?
end end
it "copies the untrusted status of the original array if the passed count is not 0" do it "copies the untrusted status of the original array if the passed count is not 0" do
ary = [1, 2, 3] ary = [1, 2, 3]
ary.untrust ary.untrust
(ary * 1).untrusted?.should == true (ary * 1).should.untrusted?
(ary * 2).untrusted?.should == true (ary * 2).should.untrusted?
end end
end end
end end

View file

@ -26,8 +26,8 @@ describe :array_clone, shared: true do
aa = a.send @method aa = a.send @method
bb = b.send @method bb = b.send @method
aa.tainted?.should == true aa.should.tainted?
bb.tainted?.should == false bb.should_not.tainted?
end end
it "copies untrusted status from the original" do it "copies untrusted status from the original" do
@ -37,8 +37,8 @@ describe :array_clone, shared: true do
aa = a.send @method aa = a.send @method
bb = b.send @method bb = b.send @method
aa.untrusted?.should == true aa.should.untrusted?
bb.untrusted?.should == false bb.should_not.untrusted?
end end
end end
end end

View file

@ -58,9 +58,9 @@ describe "Array#sort" do
b = ArraySpecs::MockForCompared.new b = ArraySpecs::MockForCompared.new
c = ArraySpecs::MockForCompared.new c = ArraySpecs::MockForCompared.new
ArraySpecs::MockForCompared.compared?.should == false ArraySpecs::MockForCompared.should_not.compared?
[a, b, c].sort.should == [c, b, a] [a, b, c].sort.should == [c, b, a]
ArraySpecs::MockForCompared.compared?.should == true ArraySpecs::MockForCompared.should.compared?
end end
it "does not deal with exceptions raised by unimplemented or incorrect #<=>" do it "does not deal with exceptions raised by unimplemented or incorrect #<=>" do
@ -104,7 +104,7 @@ describe "Array#sort" do
it "does not freezes self during being sorted" do it "does not freezes self during being sorted" do
a = [1, 2, 3] a = [1, 2, 3]
a.sort { |x,y| a.frozen?.should == false; x <=> y } a.sort { |x,y| a.should_not.frozen?; x <=> y }
end end
it "returns the specified value when it would break in the given block" do it "returns the specified value when it would break in the given block" do
@ -207,9 +207,9 @@ describe "Array#sort!" do
b = ArraySpecs::MockForCompared.new b = ArraySpecs::MockForCompared.new
c = ArraySpecs::MockForCompared.new c = ArraySpecs::MockForCompared.new
ArraySpecs::MockForCompared.compared?.should == false ArraySpecs::MockForCompared.should_not.compared?
[a, b, c].sort!.should == [c, b, a] [a, b, c].sort!.should == [c, b, a]
ArraySpecs::MockForCompared.compared?.should == true ArraySpecs::MockForCompared.should.compared?
end end
it "does not call #<=> on contained objects when invoked with a block" do it "does not call #<=> on contained objects when invoked with a block" do

View file

@ -87,8 +87,8 @@ describe "Array#uniq" do
end end
a.uniq.should == a a.uniq.should == a
a[0].tainted?.should == true a[0].should.tainted?
a[1].tainted?.should == true a[1].should.tainted?
a = Array.new(2) do a = Array.new(2) do
obj = mock('0') obj = mock('0')
@ -106,8 +106,8 @@ describe "Array#uniq" do
end end
a.uniq.size.should == 1 a.uniq.size.should == 1
a[0].tainted?.should == true a[0].should.tainted?
a[1].tainted?.should == true a[1].should.tainted?
end end
end end

View file

@ -30,7 +30,7 @@ describe "Class#allocate" do
end end
end end
klass.allocate.initialized?.should == false klass.allocate.should_not.initialized?
end end
it "raises TypeError for #superclass" do it "raises TypeError for #superclass" do

View file

@ -126,7 +126,7 @@ describe "Class#new" do
end end
end end
klass.new.initialized?.should == true klass.new.should.initialized?
klass.new(1, 2, 3).args.should == [1, 2, 3] klass.new(1, 2, 3).args.should == [1, 2, 3]
end end

View file

@ -2,31 +2,31 @@ require_relative '../../spec_helper'
describe "Complex#finite?" do describe "Complex#finite?" do
it "returns true if magnitude is finite" do it "returns true if magnitude is finite" do
(1+1i).finite?.should == true (1+1i).should.finite?
end end
it "returns false for positive infinity" do it "returns false for positive infinity" do
value = Complex(Float::INFINITY, 42) value = Complex(Float::INFINITY, 42)
value.finite?.should == false value.should_not.finite?
end end
it "returns false for positive complex with infinite imaginary" do it "returns false for positive complex with infinite imaginary" do
value = Complex(1, Float::INFINITY) value = Complex(1, Float::INFINITY)
value.finite?.should == false value.should_not.finite?
end end
it "returns false for negative infinity" do it "returns false for negative infinity" do
value = -Complex(Float::INFINITY, 42) value = -Complex(Float::INFINITY, 42)
value.finite?.should == false value.should_not.finite?
end end
it "returns false for negative complex with infinite imaginary" do it "returns false for negative complex with infinite imaginary" do
value = -Complex(1, Float::INFINITY) value = -Complex(1, Float::INFINITY)
value.finite?.should == false value.should_not.finite?
end end
it "returns false for NaN" do it "returns false for NaN" do
value = Complex(Float::NAN, Float::NAN) value = Complex(Float::NAN, Float::NAN)
value.finite?.should == false value.should_not.finite?
end end
end end

View file

@ -119,7 +119,7 @@ describe "Dir.glob" do
end end
it "handles infinite directory wildcards" do it "handles infinite directory wildcards" do
Dir.glob('**/**/**').empty?.should == false Dir.glob('**/**/**').should_not.empty?
end end
it "handles simple filename patterns" do it "handles simple filename patterns" do

View file

@ -17,7 +17,7 @@ describe "Dir.home" do
end end
it "returns a non-frozen string" do it "returns a non-frozen string" do
Dir.home.frozen?.should == false Dir.home.should_not.frozen?
end end
end end
@ -35,7 +35,7 @@ describe "Dir.home" do
end end
it "returns a non-frozen string" do it "returns a non-frozen string" do
Dir.home(ENV['USER']).frozen?.should == false Dir.home(ENV['USER']).should_not.frozen?
end end
end end

View file

@ -66,7 +66,7 @@ describe :dir_open, shared: true do
Dir.send(@method, DirSpecs.mock_dir) do |dir| Dir.send(@method, DirSpecs.mock_dir) do |dir|
io = IO.for_fd(dir.fileno) io = IO.for_fd(dir.fileno)
io.autoclose = false io.autoclose = false
io.close_on_exec?.should == true io.should.close_on_exec?
end end
end end
end end

View file

@ -10,13 +10,13 @@ describe "Enumerable#all?" do
end end
it "always returns true on empty enumeration" do it "always returns true on empty enumeration" do
@empty.all?.should == true @empty.should.all?
@empty.all? { nil }.should == true @empty.all? { nil }.should == true
[].all?.should == true [].should.all?
[].all? { false }.should == true [].all? { false }.should == true
{}.all?.should == true {}.should.all?
{}.all? { nil }.should == true {}.all? { nil }.should == true
end end
@ -38,24 +38,24 @@ describe "Enumerable#all?" do
describe "with no block" do describe "with no block" do
it "returns true if no elements are false or nil" do it "returns true if no elements are false or nil" do
@enum.all?.should == true @enum.should.all?
@enum1.all?.should == true @enum1.should.all?
@enum2.all?.should == false @enum2.should_not.all?
EnumerableSpecs::Numerous.new('a','b','c').all?.should == true EnumerableSpecs::Numerous.new('a','b','c').should.all?
EnumerableSpecs::Numerous.new(0, "x", true).all?.should == true EnumerableSpecs::Numerous.new(0, "x", true).should.all?
end end
it "returns false if there are false or nil elements" do it "returns false if there are false or nil elements" do
EnumerableSpecs::Numerous.new(false).all?.should == false EnumerableSpecs::Numerous.new(false).should_not.all?
EnumerableSpecs::Numerous.new(false, false).all?.should == false EnumerableSpecs::Numerous.new(false, false).should_not.all?
EnumerableSpecs::Numerous.new(nil).all?.should == false EnumerableSpecs::Numerous.new(nil).should_not.all?
EnumerableSpecs::Numerous.new(nil, nil).all?.should == false EnumerableSpecs::Numerous.new(nil, nil).should_not.all?
EnumerableSpecs::Numerous.new(1, nil, 2).all?.should == false EnumerableSpecs::Numerous.new(1, nil, 2).should_not.all?
EnumerableSpecs::Numerous.new(0, "x", false, true).all?.should == false EnumerableSpecs::Numerous.new(0, "x", false, true).should_not.all?
@enum2.all?.should == false @enum2.should_not.all?
end end
it "gathers whole arrays as elements when each yields multiple" do it "gathers whole arrays as elements when each yields multiple" do

View file

@ -10,13 +10,13 @@ describe "Enumerable#any?" do
end end
it "always returns false on empty enumeration" do it "always returns false on empty enumeration" do
@empty.any?.should == false @empty.should_not.any?
@empty.any? { nil }.should == false @empty.any? { nil }.should == false
[].any?.should == false [].should_not.any?
[].any? { false }.should == false [].any? { false }.should == false
{}.any?.should == false {}.should_not.any?
{}.any? { nil }.should == false {}.any? { nil }.should == false
end end
@ -38,24 +38,24 @@ describe "Enumerable#any?" do
describe "with no block" do describe "with no block" do
it "returns true if any element is not false or nil" do it "returns true if any element is not false or nil" do
@enum.any?.should == true @enum.should.any?
@enum1.any?.should == true @enum1.should.any?
@enum2.any?.should == true @enum2.should.any?
EnumerableSpecs::Numerous.new(true).any?.should == true EnumerableSpecs::Numerous.new(true).should.any?
EnumerableSpecs::Numerous.new('a','b','c').any?.should == true EnumerableSpecs::Numerous.new('a','b','c').should.any?
EnumerableSpecs::Numerous.new('a','b','c', nil).any?.should == true EnumerableSpecs::Numerous.new('a','b','c', nil).should.any?
EnumerableSpecs::Numerous.new(1, nil, 2).any?.should == true EnumerableSpecs::Numerous.new(1, nil, 2).should.any?
EnumerableSpecs::Numerous.new(1, false).any?.should == true EnumerableSpecs::Numerous.new(1, false).should.any?
EnumerableSpecs::Numerous.new(false, nil, 1, false).any?.should == true EnumerableSpecs::Numerous.new(false, nil, 1, false).should.any?
EnumerableSpecs::Numerous.new(false, 0, nil).any?.should == true EnumerableSpecs::Numerous.new(false, 0, nil).should.any?
end end
it "returns false if all elements are false or nil" do it "returns false if all elements are false or nil" do
EnumerableSpecs::Numerous.new(false).any?.should == false EnumerableSpecs::Numerous.new(false).should_not.any?
EnumerableSpecs::Numerous.new(false, false).any?.should == false EnumerableSpecs::Numerous.new(false, false).should_not.any?
EnumerableSpecs::Numerous.new(nil).any?.should == false EnumerableSpecs::Numerous.new(nil).should_not.any?
EnumerableSpecs::Numerous.new(nil, nil).any?.should == false EnumerableSpecs::Numerous.new(nil, nil).should_not.any?
EnumerableSpecs::Numerous.new(nil, false, nil).any?.should == false EnumerableSpecs::Numerous.new(nil, false, nil).should_not.any?
end end
it "gathers whole arrays as elements when each yields multiple" do it "gathers whole arrays as elements when each yields multiple" do

View file

@ -10,7 +10,7 @@ describe "Enumerable#none?" do
end end
it "always returns true on empty enumeration" do it "always returns true on empty enumeration" do
@empty.none?.should == true @empty.should.none?
@empty.none? { true }.should == true @empty.none? { true }.should == true
end end

View file

@ -10,7 +10,7 @@ describe "Enumerable#one?" do
end end
it "always returns false on empty enumeration" do it "always returns false on empty enumeration" do
@empty.one?.should == false @empty.should_not.one?
@empty.one? { true }.should == false @empty.one? { true }.should == false
end end

View file

@ -79,8 +79,8 @@ describe 'Enumerable#uniq' do
end end
a.uniq.should == a a.uniq.should == a
a[0].tainted?.should == true a[0].should.tainted?
a[1].tainted?.should == true a[1].should.tainted?
a = Array.new(2) do a = Array.new(2) do
obj = mock('0') obj = mock('0')
@ -98,8 +98,8 @@ describe 'Enumerable#uniq' do
end end
a.to_enum.uniq.size.should == 1 a.to_enum.uniq.size.should == 1
a[0].tainted?.should == true a[0].should.tainted?
a[1].tainted?.should == true a[1].should.tainted?
end end
end end

View file

@ -4,15 +4,15 @@ ruby_version_is "2.6" do
describe "Enumerator::ArithmeticSequence#exclude_end?" do describe "Enumerator::ArithmeticSequence#exclude_end?" do
context "when created using Numeric#step" do context "when created using Numeric#step" do
it "always returns false" do it "always returns false" do
1.step(10).exclude_end?.should == false 1.step(10).should_not.exclude_end?
10.step(1).exclude_end?.should == false 10.step(1).should_not.exclude_end?
end end
end end
context "when created using Range#step" do context "when created using Range#step" do
it "mirrors range.exclude_end?" do it "mirrors range.exclude_end?" do
(1...10).step.exclude_end?.should == true (1...10).step.should.exclude_end?
(1..10).step.exclude_end?.should == false (1..10).step.should_not.exclude_end?
end end
end end
end end

View file

@ -16,7 +16,7 @@ describe "ENV.[]" do
it "returns only frozen values" do it "returns only frozen values" do
ENV[@variable] = "a non-frozen string" ENV[@variable] = "a non-frozen string"
ENV[@variable].frozen?.should == true ENV[@variable].should.frozen?
end end
it "coerces a non-string name with #to_str" do it "coerces a non-string name with #to_str" do

View file

@ -4,12 +4,12 @@ describe "ENV.empty?" do
it "returns true if the Environment is empty" do it "returns true if the Environment is empty" do
if ENV.keys.size > 0 if ENV.keys.size > 0
ENV.empty?.should == false ENV.should_not.empty?
end end
orig = ENV.to_hash orig = ENV.to_hash
begin begin
ENV.clear ENV.clear
ENV.empty?.should == true ENV.should.empty?
ensure ensure
ENV.replace orig ENV.replace orig
end end
@ -17,7 +17,7 @@ describe "ENV.empty?" do
it "returns false if not empty" do it "returns false if not empty" do
if ENV.keys.size > 0 if ENV.keys.size > 0
ENV.empty?.should == false ENV.should_not.empty?
end end
end end
end end

View file

@ -2,7 +2,7 @@ require_relative '../../spec_helper'
describe "ENV.shift" do describe "ENV.shift" do
it "returns a pair and deletes it" do it "returns a pair and deletes it" do
ENV.empty?.should == false ENV.should_not.empty?
orig = ENV.to_hash orig = ENV.to_hash
begin begin
pair = ENV.shift pair = ENV.shift

View file

@ -3,13 +3,13 @@ require_relative '../../spec_helper'
describe "SystemExit#success?" do describe "SystemExit#success?" do
it "returns true if the process exited successfully" do it "returns true if the process exited successfully" do
-> { exit 0 }.should raise_error(SystemExit) { |e| -> { exit 0 }.should raise_error(SystemExit) { |e|
e.success?.should == true e.should.success?
} }
end end
it "returns false if the process exited unsuccessfully" do it "returns false if the process exited unsuccessfully" do
-> { exit(-1) }.should raise_error(SystemExit) { |e| -> { exit(-1) }.should raise_error(SystemExit) { |e|
e.success?.should == false e.should_not.success?
} }
end end
end end

View file

@ -7,7 +7,7 @@ describe "FalseClass#to_s" do
ruby_version_is "2.7" do ruby_version_is "2.7" do
it "returns a frozen string" do it "returns a frozen string" do
false.to_s.frozen?.should == true false.to_s.should.frozen?
end end
it "always returns the same string" do it "always returns the same string" do

View file

@ -203,9 +203,9 @@ platform_is_not :windows do
it "does not return a frozen string" do it "does not return a frozen string" do
home = "/rubyspec_home" home = "/rubyspec_home"
File.expand_path('~').frozen?.should == false File.expand_path('~').should_not.frozen?
File.expand_path('~', '/tmp/gumby/ddd').frozen?.should == false File.expand_path('~', '/tmp/gumby/ddd').should_not.frozen?
File.expand_path('~/a', '/tmp/gumby/ddd').frozen?.should == false File.expand_path('~/a', '/tmp/gumby/ddd').should_not.frozen?
end end
end end

View file

@ -20,13 +20,13 @@ describe "File.lchmod" do
File.chmod(0222, @lname).should == 1 File.chmod(0222, @lname).should == 1
File.lchmod(0755, @lname).should == 1 File.lchmod(0755, @lname).should == 1
File.lstat(@lname).executable?.should == true File.lstat(@lname).should.executable?
File.lstat(@lname).readable?.should == true File.lstat(@lname).should.readable?
File.lstat(@lname).writable?.should == true File.lstat(@lname).should.writable?
File.stat(@lname).executable?.should == false File.stat(@lname).should_not.executable?
File.stat(@lname).readable?.should == false File.stat(@lname).should_not.readable?
File.stat(@lname).writable?.should == true File.stat(@lname).should.writable?
end end
end end

View file

@ -22,8 +22,8 @@ describe "File.lstat" do
it "returns a File::Stat object with symlink properties for a symlink" do it "returns a File::Stat object with symlink properties for a symlink" do
st = File.lstat(@link) st = File.lstat(@link)
st.symlink?.should == true st.should.symlink?
st.file?.should == false st.should_not.file?
end end
end end
end end

View file

@ -28,7 +28,7 @@ describe "File.open" do
describe "with a block" do describe "with a block" do
it "does not raise error when file is closed inside the block" do it "does not raise error when file is closed inside the block" do
@fh = File.open(@file) { |fh| fh.close; fh } @fh = File.open(@file) { |fh| fh.close; fh }
@fh.closed?.should == true @fh.should.closed?
end end
it "invokes close on an opened file when exiting the block" do it "invokes close on an opened file when exiting the block" do
@ -485,7 +485,7 @@ describe "File.open" do
File.size(@file).should > 0 File.size(@file).should > 0
File.open(@file, "w+") do |f| File.open(@file, "w+") do |f|
f.pos.should == 0 f.pos.should == 0
f.eof?.should == true f.should.eof?
end end
File.size(@file).should == 0 File.size(@file).should == 0
end end
@ -495,7 +495,7 @@ describe "File.open" do
File.size(@file).should > 0 File.size(@file).should > 0
File.open(@file, "rb+") do |f| File.open(@file, "rb+") do |f|
f.pos.should == 0 f.pos.should == 0
f.eof?.should == false f.should_not.eof?
end end
end end
@ -504,7 +504,7 @@ describe "File.open" do
File.size(@file).should > 0 File.size(@file).should > 0
File.open(@file, "wb+") do |f| File.open(@file, "wb+") do |f|
f.pos.should == 0 f.pos.should == 0
f.eof?.should == true f.should.eof?
end end
File.size(@file).should == 0 File.size(@file).should == 0
end end

View file

@ -18,7 +18,7 @@ describe "File::Stat#owned?" do
it "returns true if the file is owned by the user" do it "returns true if the file is owned by the user" do
st = File.stat(@file) st = File.stat(@file)
st.owned?.should == true st.should.owned?
end end
platform_is_not :windows, :android do platform_is_not :windows, :android do
@ -26,7 +26,7 @@ describe "File::Stat#owned?" do
it "returns false if the file is not owned by the user" do it "returns false if the file is not owned by the user" do
system_file = '/etc/passwd' system_file = '/etc/passwd'
st = File.stat(system_file) st = File.stat(system_file)
st.owned?.should == false st.should_not.owned?
end end
end end
end end

View file

@ -12,7 +12,7 @@ describe "File::Stat#pipe?" do
touch(filename) touch(filename)
st = File.stat(filename) st = File.stat(filename)
st.pipe?.should == false st.should_not.pipe?
rm_r filename rm_r filename
end end
@ -23,7 +23,7 @@ describe "File::Stat#pipe?" do
File.mkfifo(filename) File.mkfifo(filename)
st = File.stat(filename) st = File.stat(filename)
st.pipe?.should == true st.should.pipe?
rm_r filename rm_r filename
end end

View file

@ -23,8 +23,8 @@ platform_is_not :windows do
st = f.stat st = f.stat
st.file?.should == true st.should.file?
st.zero?.should == false st.should_not.zero?
st.size.should == 8 st.size.should == 8
st.size?.should == 8 st.size?.should == 8
st.blksize.should >= 0 st.blksize.should >= 0
@ -38,8 +38,8 @@ platform_is_not :windows do
File.symlink(@file, @link) File.symlink(@file, @link)
st = File.stat(@link) st = File.stat(@link)
st.file?.should == true st.should.file?
st.symlink?.should == false st.should_not.symlink?
end end
it "returns an error when given missing non-ASCII path" do it "returns an error when given missing non-ASCII path" do

View file

@ -18,7 +18,7 @@ describe "File.truncate" do
File.open(@name, "r") do |f| File.open(@name, "r") do |f|
f.read(99).should == "12345" f.read(99).should == "12345"
f.eof?.should == true f.should.eof?
end end
end end
@ -120,7 +120,7 @@ describe "File#truncate" do
File.size(@name).should == 5 File.size(@name).should == 5
File.open(@name, "r") do |f| File.open(@name, "r") do |f|
f.read(99).should == "12345" f.read(99).should == "12345"
f.eof?.should == true f.should.eof?
end end
end end
@ -161,7 +161,7 @@ describe "File#truncate" do
it "raises an IOError if file is closed" do it "raises an IOError if file is closed" do
@file.close @file.close
@file.closed?.should == true @file.should.closed?
-> { @file.truncate(42) }.should raise_error(IOError) -> { @file.truncate(42) }.should raise_error(IOError)
end end

View file

@ -2,18 +2,18 @@ require_relative '../../spec_helper'
describe "Float#finite?" do describe "Float#finite?" do
it "returns true for finite values" do it "returns true for finite values" do
3.14159.finite?.should == true 3.14159.should.finite?
end end
it "returns false for positive infinity" do it "returns false for positive infinity" do
infinity_value.finite?.should == false infinity_value.should_not.finite?
end end
it "returns false for negative infinity" do it "returns false for negative infinity" do
(-infinity_value).finite?.should == false (-infinity_value).should_not.finite?
end end
it "returns false for NaN" do it "returns false for NaN" do
nan_value.finite?.should == false nan_value.should_not.finite?
end end
end end

View file

@ -2,8 +2,8 @@ require_relative '../../spec_helper'
describe "Float#nan?" do describe "Float#nan?" do
it "returns true if self is not a valid IEEE floating-point number" do it "returns true if self is not a valid IEEE floating-point number" do
0.0.nan?.should == false 0.0.should_not.nan?
-1.5.nan?.should == false -1.5.should_not.nan?
nan_value.nan?.should == true nan_value.should.nan?
end end
end end

View file

@ -44,6 +44,6 @@ describe "Float#next_float" do
end end
it "returns NAN if NAN was the receiver" do it "returns NAN if NAN was the receiver" do
Float::NAN.next_float.nan?.should == true Float::NAN.next_float.should.nan?
end end
end end

View file

@ -44,6 +44,6 @@ describe "Float#prev_float" do
end end
it "returns NAN if NAN was the receiver" do it "returns NAN if NAN was the receiver" do
Float::NAN.prev_float.nan?.should == true Float::NAN.prev_float.should.nan?
end end
end end

View file

@ -23,6 +23,6 @@ describe "Float#-@" do
end end
it "returns NaN for NaN" do it "returns NaN for NaN" do
nan_value.send(:-@).nan?.should == true nan_value.send(:-@).should.nan?
end end
end end

View file

@ -2,8 +2,8 @@ require_relative '../../spec_helper'
describe "Float#zero?" do describe "Float#zero?" do
it "returns true if self is 0.0" do it "returns true if self is 0.0" do
0.0.zero?.should == true 0.0.should.zero?
1.0.zero?.should == false 1.0.should_not.zero?
-1.0.zero?.should == false -1.0.should_not.zero?
end end
end end

View file

@ -11,6 +11,6 @@ describe "GC::Profiler.disable" do
it "disables the profiler" do it "disables the profiler" do
GC::Profiler.disable GC::Profiler.disable
GC::Profiler.enabled?.should == false GC::Profiler.should_not.enabled?
end end
end end

View file

@ -12,6 +12,6 @@ describe "GC::Profiler.enable" do
it "enables the profiler" do it "enables the profiler" do
GC::Profiler.enable GC::Profiler.enable
GC::Profiler.enabled?.should == true GC::Profiler.should.enabled?
end end
end end

View file

@ -4,10 +4,10 @@ describe "Hash#any?" do
describe 'with no block given' do describe 'with no block given' do
it "checks if there are any members of a Hash" do it "checks if there are any members of a Hash" do
empty_hash = {} empty_hash = {}
empty_hash.any?.should == false empty_hash.should_not.any?
hash_with_members = { 'key' => 'value' } hash_with_members = { 'key' => 'value' }
hash_with_members.any?.should == true hash_with_members.should.any?
end end
end end

View file

@ -33,7 +33,7 @@ describe "Hash#compare_by_identity" do
it "has no effect on an already compare_by_identity hash" do it "has no effect on an already compare_by_identity hash" do
@idh[:foo] = :bar @idh[:foo] = :bar
@idh.compare_by_identity.should equal @idh @idh.compare_by_identity.should equal @idh
@idh.compare_by_identity?.should == true @idh.should.compare_by_identity?
@idh[:foo].should == :bar @idh[:foo].should == :bar
end end

View file

@ -3,13 +3,13 @@ require_relative 'fixtures/classes'
describe "Hash#empty?" do describe "Hash#empty?" do
it "returns true if the hash has no entries" do it "returns true if the hash has no entries" do
{}.empty?.should == true {}.should.empty?
{ 1 => 1 }.empty?.should == false { 1 => 1 }.should_not.empty?
end end
it "returns true if the hash has no entries and has a default value" do it "returns true if the hash has no entries and has a default value" do
Hash.new(5).empty?.should == true Hash.new(5).should.empty?
Hash.new { 5 }.empty?.should == true Hash.new { 5 }.should.empty?
Hash.new { |hsh, k| hsh[k] = k }.empty?.should == true Hash.new { |hsh, k| hsh[k] = k }.should.empty?
end end
end end

View file

@ -35,7 +35,7 @@ describe "Hash#reject" do
ruby_version_is ''...'2.7' do ruby_version_is ''...'2.7' do
it "does not taint the resulting hash" do it "does not taint the resulting hash" do
h = { a: 1 }.taint h = { a: 1 }.taint
h.reject {false}.tainted?.should == false h.reject {false}.should_not.tainted?
end end
end end
end end

View file

@ -50,7 +50,7 @@ describe :hash_store, shared: true do
key << "bar" key << "bar"
h.should == { "foo" => 0 } h.should == { "foo" => 0 }
h.keys[0].frozen?.should == true h.keys[0].should.frozen?
end end
it "doesn't duplicate and freeze already frozen string keys" do it "doesn't duplicate and freeze already frozen string keys" do

View file

@ -21,13 +21,13 @@ describe "Hash#to_proc" do
ruby_version_is ""..."2.8" do ruby_version_is ""..."2.8" do
it "is not a lambda" do it "is not a lambda" do
@proc.lambda?.should == false @proc.should_not.lambda?
end end
end end
ruby_version_is "2.8" do ruby_version_is "2.8" do
it "is a lambda" do it "is a lambda" do
@proc.lambda?.should == true @proc.should.lambda?
end end
end end

View file

@ -13,8 +13,8 @@ end
describe "Integer#integer?" do describe "Integer#integer?" do
it "returns true for Integers" do it "returns true for Integers" do
0.integer?.should == true 0.should.integer?
-1.integer?.should == true -1.should.integer?
bignum_value.integer?.should == true bignum_value.should.integer?
end end
end end

View file

@ -14,24 +14,24 @@ describe "IO#close_on_exec=" do
guard -> { platform_is_not :windows } do guard -> { platform_is_not :windows } do
it "sets the close-on-exec flag if true" do it "sets the close-on-exec flag if true" do
@io.close_on_exec = true @io.close_on_exec = true
@io.close_on_exec?.should == true @io.should.close_on_exec?
end end
it "sets the close-on-exec flag if non-false" do it "sets the close-on-exec flag if non-false" do
@io.close_on_exec = :true @io.close_on_exec = :true
@io.close_on_exec?.should == true @io.should.close_on_exec?
end end
it "unsets the close-on-exec flag if false" do it "unsets the close-on-exec flag if false" do
@io.close_on_exec = true @io.close_on_exec = true
@io.close_on_exec = false @io.close_on_exec = false
@io.close_on_exec?.should == false @io.should_not.close_on_exec?
end end
it "unsets the close-on-exec flag if nil" do it "unsets the close-on-exec flag if nil" do
@io.close_on_exec = true @io.close_on_exec = true
@io.close_on_exec = nil @io.close_on_exec = nil
@io.close_on_exec?.should == false @io.should_not.close_on_exec?
end end
it "ensures the IO's file descriptor is closed in exec'ed processes" do it "ensures the IO's file descriptor is closed in exec'ed processes" do
@ -64,12 +64,12 @@ describe "IO#close_on_exec?" do
guard -> { platform_is_not :windows } do guard -> { platform_is_not :windows } do
it "returns true by default" do it "returns true by default" do
@io.close_on_exec?.should == true @io.should.close_on_exec?
end end
it "returns true if set" do it "returns true if set" do
@io.close_on_exec = true @io.close_on_exec = true
@io.close_on_exec?.should == true @io.should.close_on_exec?
end end
it "raises IOError if called on a closed IO" do it "raises IOError if called on a closed IO" do

View file

@ -49,7 +49,7 @@ describe "IO#close_read" do
io.close_read io.close_read
io.closed?.should == true io.should.closed?
end end
it "does nothing on closed stream" do it "does nothing on closed stream" do

View file

@ -14,7 +14,7 @@ describe "IO#close" do
it "closes the stream" do it "closes the stream" do
@io.close @io.close
@io.closed?.should == true @io.should.closed?
end end
it "returns nil" do it "returns nil" do

View file

@ -45,7 +45,7 @@ describe "IO#close_write" do
io.close_write io.close_write
io.closed?.should == true io.should.closed?
end end
it "flushes and closes the write stream" do it "flushes and closes the write stream" do

View file

@ -51,16 +51,16 @@ end
@i.close @i.close
-> { @f.gets }.should_not raise_error(Exception) -> { @f.gets }.should_not raise_error(Exception)
@i.closed?.should == true @i.should.closed?
@f.closed?.should == false @f.should_not.closed?
end end
it "allows closing the original IO without affecting the new one" do it "allows closing the original IO without affecting the new one" do
@f.close @f.close
-> { @i.gets }.should_not raise_error(Exception) -> { @i.gets }.should_not raise_error(Exception)
@i.closed?.should == false @i.should_not.closed?
@f.closed?.should == true @f.should.closed?
end end
it "raises IOError on closed stream" do it "raises IOError on closed stream" do
@ -71,7 +71,7 @@ end
@f.close_on_exec = true @f.close_on_exec = true
dup = @f.dup dup = @f.dup
begin begin
dup.close_on_exec?.should == true dup.should.close_on_exec?
ensure ensure
dup.close dup.close
end end
@ -79,7 +79,7 @@ end
@f.close_on_exec = false @f.close_on_exec = false
dup = @f.dup dup = @f.dup
begin begin
dup.close_on_exec?.should == true dup.should.close_on_exec?
ensure ensure
dup.close dup.close
end end

View file

@ -12,7 +12,7 @@ describe "IO#eof?" do
end end
it "returns true on an empty stream that has just been opened" do it "returns true on an empty stream that has just been opened" do
File.open(@name) { |empty| empty.eof?.should == true } File.open(@name) { |empty| empty.should.eof? }
end end
it "raises IOError on stream not opened for reading" do it "raises IOError on stream not opened for reading" do
@ -34,35 +34,35 @@ describe "IO#eof?" do
it "returns false when not at end of file" do it "returns false when not at end of file" do
@io.read 1 @io.read 1
@io.eof?.should == false @io.should_not.eof?
end end
it "returns true after reading with read with no parameters" do it "returns true after reading with read with no parameters" do
@io.read() @io.read()
@io.eof?.should == true @io.should.eof?
end end
it "returns true after reading with read" do it "returns true after reading with read" do
@io.read(File.size(@name)) @io.read(File.size(@name))
@io.eof?.should == true @io.should.eof?
end end
it "returns true after reading with sysread" do it "returns true after reading with sysread" do
@io.sysread(File.size(@name)) @io.sysread(File.size(@name))
@io.eof?.should == true @io.should.eof?
end end
it "returns true after reading with readlines" do it "returns true after reading with readlines" do
@io.readlines @io.readlines
@io.eof?.should == true @io.should.eof?
end end
it "returns false on just opened non-empty stream" do it "returns false on just opened non-empty stream" do
@io.eof?.should == false @io.should_not.eof?
end end
it "does not consume the data from the stream" do it "does not consume the data from the stream" do
@io.eof?.should == false @io.should_not.eof?
@io.getc.should == 'V' @io.getc.should == 'V'
end end
@ -78,7 +78,7 @@ describe "IO#eof?" do
it "returns true on one-byte stream after single-byte read" do it "returns true on one-byte stream after single-byte read" do
File.open(File.dirname(__FILE__) + '/fixtures/one_byte.txt') { |one_byte| File.open(File.dirname(__FILE__) + '/fixtures/one_byte.txt') { |one_byte|
one_byte.read(1) one_byte.read(1)
one_byte.eof?.should == true one_byte.should.eof?
} }
end end
end end
@ -92,16 +92,16 @@ describe "IO#eof?" do
it "returns true on receiving side of Pipe when writing side is closed" do it "returns true on receiving side of Pipe when writing side is closed" do
@r, @w = IO.pipe @r, @w = IO.pipe
@w.close @w.close
@r.eof?.should == true @r.should.eof?
end end
it "returns false on receiving side of Pipe when writing side wrote some data" do it "returns false on receiving side of Pipe when writing side wrote some data" do
@r, @w = IO.pipe @r, @w = IO.pipe
@w.puts "hello" @w.puts "hello"
@r.eof?.should == false @r.should_not.eof?
@w.close @w.close
@r.eof?.should == false @r.should_not.eof?
@r.read @r.read
@r.eof?.should == true @r.should.eof?
end end
end end

View file

@ -41,7 +41,7 @@ describe "IO#gets" do
ruby_version_is ''...'2.7' do ruby_version_is ''...'2.7' do
it "returns tainted strings" do it "returns tainted strings" do
while line = @io.gets while line = @io.gets
line.tainted?.should == true line.should.tainted?
end end
end end
end end
@ -67,7 +67,7 @@ describe "IO#gets" do
ruby_version_is ''...'2.7' do ruby_version_is ''...'2.7' do
it "returns tainted strings" do it "returns tainted strings" do
while line = @io.gets(nil) while line = @io.gets(nil)
line.tainted?.should == true line.should.tainted?
end end
end end
end end
@ -103,7 +103,7 @@ describe "IO#gets" do
ruby_version_is ''...'2.7' do ruby_version_is ''...'2.7' do
it "returns tainted strings" do it "returns tainted strings" do
while line = @io.gets("") while line = @io.gets("")
line.tainted?.should == true line.should.tainted?
end end
end end
end end
@ -129,7 +129,7 @@ describe "IO#gets" do
ruby_version_is ''...'2.7' do ruby_version_is ''...'2.7' do
it "returns tainted strings" do it "returns tainted strings" do
while line = @io.gets("la") while line = @io.gets("la")
line.tainted?.should == true line.should.tainted?
end end
end end
end end

View file

@ -44,8 +44,8 @@ describe "IO.pipe" do
r, w = IO.pipe do |_r, _w| r, w = IO.pipe do |_r, _w|
[_r, _w] [_r, _w]
end end
r.closed?.should == true r.should.closed?
w.closed?.should == true w.should.closed?
end end
it "closes both IO objects when the block raises" do it "closes both IO objects when the block raises" do
@ -57,8 +57,8 @@ describe "IO.pipe" do
raise RuntimeError raise RuntimeError
end end
end.should raise_error(RuntimeError) end.should raise_error(RuntimeError)
r.closed?.should == true r.should.closed?
w.closed?.should == true w.should.closed?
end end
it "allows IO objects to be closed within the block" do it "allows IO objects to be closed within the block" do
@ -67,8 +67,8 @@ describe "IO.pipe" do
_w.close _w.close
[_r, _w] [_r, _w]
end end
r.closed?.should == true r.should.closed?
w.closed?.should == true w.should.closed?
end end
end end
end end

View file

@ -77,10 +77,10 @@ describe "IO.popen" do
Process.kill "KILL", pid Process.kill "KILL", pid
@io.close @io.close
platform_is_not :windows do platform_is_not :windows do
$?.signaled?.should == true $?.should.signaled?
end end
platform_is :windows do platform_is :windows do
$?.exited?.should == true $?.should.exited?
end end
end end

View file

@ -46,7 +46,7 @@ describe "IO#read_nonblock" do
require 'io/nonblock' require 'io/nonblock'
@write.write "abc" @write.write "abc"
@read.read_nonblock(1).should == "a" @read.read_nonblock(1).should == "a"
@read.nonblock?.should == true @read.should.nonblock?
end end
end end

View file

@ -216,7 +216,7 @@ describe "IO#read" do
it "is at end-of-file when everything has been read" do it "is at end-of-file when everything has been read" do
@io.read @io.read
@io.eof?.should == true @io.should.eof?
end end
it "reads the contents of a file" do it "reads the contents of a file" do

View file

@ -150,11 +150,11 @@ describe "IO#reopen with a String" do
@io.close_on_exec = true @io.close_on_exec = true
@io.reopen @other_name @io.reopen @other_name
@io.close_on_exec?.should == true @io.should.close_on_exec?
@io.close_on_exec = false @io.close_on_exec = false
@io.reopen @other_name @io.reopen @other_name
@io.close_on_exec?.should == true @io.should.close_on_exec?
end end
it "creates the file if it doesn't exist if the IO is opened in write mode" do it "creates the file if it doesn't exist if the IO is opened in write mode" do
@ -293,12 +293,12 @@ describe "IO#reopen with an IO" do
@other_io.close_on_exec = true @other_io.close_on_exec = true
@io.close_on_exec = true @io.close_on_exec = true
@io.reopen @other_io @io.reopen @other_io
@io.close_on_exec?.should == true @io.should.close_on_exec?
@other_io.close_on_exec = false @other_io.close_on_exec = false
@io.close_on_exec = false @io.close_on_exec = false
@io.reopen @other_io @io.reopen @other_io
@io.close_on_exec?.should == true @io.should.close_on_exec?
end end
it "may change the class of the instance" do it "may change the class of the instance" do

View file

@ -21,7 +21,7 @@ describe "IO#rewind" do
it "positions the instance to the beginning of input and clears EOF" do it "positions the instance to the beginning of input and clears EOF" do
value = @io.read value = @io.read
@io.rewind @io.rewind
@io.eof?.should == false @io.should_not.eof?
value.should == @io.read value.should == @io.read
end end

View file

@ -44,21 +44,21 @@ describe "IO#seek" do
it "moves the read position and clears EOF with SEEK_SET" do it "moves the read position and clears EOF with SEEK_SET" do
value = @io.read value = @io.read
@io.seek(0, IO::SEEK_SET) @io.seek(0, IO::SEEK_SET)
@io.eof?.should == false @io.should_not.eof?
value.should == @io.read value.should == @io.read
end end
it "moves the read position and clears EOF with SEEK_CUR" do it "moves the read position and clears EOF with SEEK_CUR" do
value = @io.read value = @io.read
@io.seek(-1, IO::SEEK_CUR) @io.seek(-1, IO::SEEK_CUR)
@io.eof?.should == false @io.should_not.eof?
value[-1].should == @io.read[0] value[-1].should == @io.read[0]
end end
it "moves the read position and clears EOF with SEEK_END" do it "moves the read position and clears EOF with SEEK_END" do
value = @io.read value = @io.read
@io.seek(-1, IO::SEEK_END) @io.seek(-1, IO::SEEK_END)
@io.eof?.should == false @io.should_not.eof?
value[-1].should == @io.read[0] value[-1].should == @io.read[0]
end end

View file

@ -148,22 +148,22 @@ describe :io_new, shared: true do
it "sets binmode from mode string" do it "sets binmode from mode string" do
@io = IO.send(@method, @fd, 'wb') @io = IO.send(@method, @fd, 'wb')
@io.binmode?.should == true @io.should.binmode?
end end
it "does not set binmode without being asked" do it "does not set binmode without being asked" do
@io = IO.send(@method, @fd, 'w') @io = IO.send(@method, @fd, 'w')
@io.binmode?.should == false @io.should_not.binmode?
end end
it "sets binmode from :binmode option" do it "sets binmode from :binmode option" do
@io = IO.send(@method, @fd, 'w', binmode: true) @io = IO.send(@method, @fd, 'w', binmode: true)
@io.binmode?.should == true @io.should.binmode?
end end
it "does not set binmode from false :binmode" do it "does not set binmode from false :binmode" do
@io = IO.send(@method, @fd, 'w', binmode: false) @io = IO.send(@method, @fd, 'w', binmode: false)
@io.binmode?.should == false @io.should_not.binmode?
end end
it "sets external encoding to binary with binmode in mode string" do it "sets external encoding to binary with binmode in mode string" do
@ -270,13 +270,13 @@ describe :io_new, shared: true do
it "accepts an :autoclose option" do it "accepts an :autoclose option" do
@io = IO.send(@method, @fd, 'w', autoclose: false) @io = IO.send(@method, @fd, 'w', autoclose: false)
@io.autoclose?.should == false @io.should_not.autoclose?
@io.autoclose = true @io.autoclose = true
end end
it "accepts any truthy option :autoclose" do it "accepts any truthy option :autoclose" do
@io = IO.send(@method, @fd, 'w', autoclose: 42) @io = IO.send(@method, @fd, 'w', autoclose: 42)
@io.autoclose?.should == true @io.should.autoclose?
end end
end end

View file

@ -27,7 +27,7 @@ describe :io_pos, shared: true do
io.read 1 io.read 1
io.read 1 io.read 1
io.send(@method) io.send(@method)
io.eof?.should == false io.should_not.eof?
end end
end end
end end

View file

@ -74,10 +74,10 @@ describe "IO#ungetc" do
touch(@empty) touch(@empty)
File.open(@empty) { |empty| File.open(@empty) { |empty|
empty.eof?.should == true empty.should.eof?
empty.getc.should == nil empty.getc.should == nil
empty.ungetc(100) empty.ungetc(100)
empty.eof?.should == false empty.should_not.eof?
} }
end end

View file

@ -79,7 +79,7 @@ describe 'IO#write_nonblock' do
it 'sets the IO in nonblock mode' do it 'sets the IO in nonblock mode' do
require 'io/nonblock' require 'io/nonblock'
@write.write_nonblock('a') @write.write_nonblock('a')
@write.nonblock?.should == true @write.should.nonblock?
end end
end end
end end

View file

@ -40,16 +40,16 @@ describe "Kernel#`" do
ip = 'world' ip = 'world'
`echo disc #{ip}` `echo disc #{ip}`
$?.should be_kind_of(Process::Status) $?.should be_kind_of(Process::Status)
$?.stopped?.should == false $?.should_not.stopped?
$?.exited?.should == true $?.should.exited?
$?.exitstatus.should == 0 $?.exitstatus.should == 0
$?.success?.should == true $?.should.success?
`echo disc #{ip}; exit 99` `echo disc #{ip}; exit 99`
$?.should be_kind_of(Process::Status) $?.should be_kind_of(Process::Status)
$?.stopped?.should == false $?.should_not.stopped?
$?.exited?.should == true $?.should.exited?
$?.exitstatus.should == 99 $?.exitstatus.should == 99
$?.success?.should == false $?.should_not.success?
end end
end end
@ -58,16 +58,16 @@ describe "Kernel#`" do
ip = 'world' ip = 'world'
`echo disc #{ip}` `echo disc #{ip}`
$?.should be_kind_of(Process::Status) $?.should be_kind_of(Process::Status)
$?.stopped?.should == false $?.should_not.stopped?
$?.exited?.should == true $?.should.exited?
$?.exitstatus.should == 0 $?.exitstatus.should == 0
$?.success?.should == true $?.should.success?
`echo disc #{ip}& exit 99` `echo disc #{ip}& exit 99`
$?.should be_kind_of(Process::Status) $?.should be_kind_of(Process::Status)
$?.stopped?.should == false $?.should_not.stopped?
$?.exited?.should == true $?.should.exited?
$?.exitstatus.should == 99 $?.exitstatus.should == 99
$?.success?.should == false $?.should_not.success?
end end
end end
end end

View file

@ -7,7 +7,7 @@ describe 'Kernel#caller_locations' do
end end
it 'returns an Array of caller locations' do it 'returns an Array of caller locations' do
KernelSpecs::CallerLocationsTest.locations.empty?.should == false KernelSpecs::CallerLocationsTest.locations.should_not.empty?
end end
it 'returns an Array of caller locations using a custom offset' do it 'returns an Array of caller locations using a custom offset' do

View file

@ -7,7 +7,7 @@ describe 'Kernel#caller' do
end end
it 'returns an Array of caller locations' do it 'returns an Array of caller locations' do
KernelSpecs::CallerTest.locations.empty?.should == false KernelSpecs::CallerTest.locations.should_not.empty?
end end
it 'returns an Array of caller locations using a custom offset' do it 'returns an Array of caller locations using a custom offset' do

View file

@ -33,22 +33,22 @@ describe "Kernel#clone" do
@obj.freeze @obj.freeze
o3 = @obj.clone o3 = @obj.clone
o2.frozen?.should == false o2.should_not.frozen?
o3.frozen?.should == true o3.should.frozen?
end end
ruby_version_is '2.8' do ruby_version_is '2.8' do
it 'takes an freeze: true option to frozen copy' do it 'takes an freeze: true option to frozen copy' do
@obj.clone(freeze: true).frozen?.should == true @obj.clone(freeze: true).should.frozen?
@obj.freeze @obj.freeze
@obj.clone(freeze: true).frozen?.should == true @obj.clone(freeze: true).should.frozen?
end end
end end
it 'takes an freeze: false option to not return frozen copy' do it 'takes an freeze: false option to not return frozen copy' do
@obj.clone(freeze: false).frozen?.should == false @obj.clone(freeze: false).should_not.frozen?
@obj.freeze @obj.freeze
@obj.clone(freeze: false).frozen?.should == false @obj.clone(freeze: false).should_not.frozen?
end end
it "copies instance variables" do it "copies instance variables" do

View file

@ -32,7 +32,7 @@ describe "Kernel#dup" do
@obj.freeze @obj.freeze
dup = @obj.dup dup = @obj.dup
dup.frozen?.should == false dup.should_not.frozen?
end end
it "copies instance variables" do it "copies instance variables" do

View file

@ -6,8 +6,8 @@ describe "Kernel#frozen?" do
o = mock('o') o = mock('o')
p = mock('p') p = mock('p')
p.freeze p.freeze
o.frozen?.should == false o.should_not.frozen?
p.frozen?.should == true p.should.frozen?
end end
describe "on true, false and nil" do describe "on true, false and nil" do

View file

@ -59,8 +59,8 @@ describe :kernel_dup_clone, shared: true do
o.taint o.taint
o3 = o.send(@method) o3 = o.send(@method)
o2.tainted?.should == false o2.should_not.tainted?
o3.tainted?.should == true o3.should.tainted?
end end
end end
@ -78,8 +78,8 @@ describe :kernel_dup_clone, shared: true do
o.untrust o.untrust
o3 = o.send(@method) o3 = o.send(@method)
o2.untrusted?.should == false o2.should_not.untrusted?
o3.untrusted?.should == true o3.should.untrusted?
end end
end end

View file

@ -6,14 +6,14 @@ describe :kernel_system, shared: true do
-> { @object.system("echo a") }.should output_to_fd("a\n") -> { @object.system("echo a") }.should output_to_fd("a\n")
$?.should be_an_instance_of Process::Status $?.should be_an_instance_of Process::Status
$?.success?.should == true $?.should.success?
end end
it "returns true when the command exits with a zero exit status" do it "returns true when the command exits with a zero exit status" do
@object.system(ruby_cmd('exit 0')).should == true @object.system(ruby_cmd('exit 0')).should == true
$?.should be_an_instance_of Process::Status $?.should be_an_instance_of Process::Status
$?.success?.should == true $?.should.success?
$?.exitstatus.should == 0 $?.exitstatus.should == 0
end end
@ -21,7 +21,7 @@ describe :kernel_system, shared: true do
@object.system(ruby_cmd('exit 1')).should == false @object.system(ruby_cmd('exit 1')).should == false
$?.should be_an_instance_of Process::Status $?.should be_an_instance_of Process::Status
$?.success?.should == false $?.should_not.success?
$?.exitstatus.should == 1 $?.exitstatus.should == 1
end end

View file

@ -11,7 +11,7 @@ describe "Kernel#taint" do
it "sets the tainted bit" do it "sets the tainted bit" do
o = Object.new o = Object.new
o.taint o.taint
o.tainted?.should == true o.should.tainted?
end end
it "raises FrozenError on an untainted, frozen object" do it "raises FrozenError on an untainted, frozen object" do
@ -27,20 +27,20 @@ describe "Kernel#taint" do
it "has no effect on immediate values" do it "has no effect on immediate values" do
[nil, true, false].each do |v| [nil, true, false].each do |v|
v.taint v.taint
v.tainted?.should == false v.should_not.tainted?
end end
end end
it "no raises a RuntimeError on symbols" do it "no raises a RuntimeError on symbols" do
v = :sym v = :sym
-> { v.taint }.should_not raise_error(RuntimeError) -> { v.taint }.should_not raise_error(RuntimeError)
v.tainted?.should == false v.should_not.tainted?
end end
it "no raises error on fixnum values" do it "no raises error on fixnum values" do
[1].each do |v| [1].each do |v|
-> { v.taint }.should_not raise_error(RuntimeError) -> { v.taint }.should_not raise_error(RuntimeError)
v.tainted?.should == false v.should_not.tainted?
end end
end end
end end

View file

@ -7,8 +7,8 @@ describe "Kernel#tainted?" do
o = mock('o') o = mock('o')
p = mock('p') p = mock('p')
p.taint p.taint
o.tainted?.should == false o.should_not.tainted?
p.tainted?.should == true p.should.tainted?
end end
end end
end end

View file

@ -11,7 +11,7 @@ describe "Kernel#trust" do
it "clears the untrusted bit" do it "clears the untrusted bit" do
o = Object.new.untrust o = Object.new.untrust
o.trust o.trust
o.untrusted?.should == false o.should_not.untrusted?
end end
it "raises FrozenError on an untrusted, frozen object" do it "raises FrozenError on an untrusted, frozen object" do

View file

@ -11,7 +11,7 @@ describe "Kernel#untaint" do
it "clears the tainted bit" do it "clears the tainted bit" do
o = Object.new.taint o = Object.new.taint
o.untaint o.untaint
o.tainted?.should == false o.should_not.tainted?
end end
it "raises FrozenError on a tainted, frozen object" do it "raises FrozenError on a tainted, frozen object" do

View file

@ -11,7 +11,7 @@ describe "Kernel#untrust" do
it "sets the untrusted bit" do it "sets the untrusted bit" do
o = Object.new o = Object.new
o.untrust o.untrust
o.untrusted?.should == true o.should.untrusted?
end end
it "raises FrozenError on a trusted, frozen object" do it "raises FrozenError on a trusted, frozen object" do

View file

@ -5,9 +5,9 @@ describe "Kernel#untrusted?" do
ruby_version_is ''...'2.7' do ruby_version_is ''...'2.7' do
it "returns the untrusted status of an object" do it "returns the untrusted status of an object" do
o = mock('o') o = mock('o')
o.untrusted?.should == false o.should_not.untrusted?
o.untrust o.untrust
o.untrusted?.should == true o.should.untrusted?
end end
it "has no effect on immediate values" do it "has no effect on immediate values" do
@ -17,9 +17,9 @@ describe "Kernel#untrusted?" do
a.untrust a.untrust
b.untrust b.untrust
c.untrust c.untrust
a.untrusted?.should == false a.should_not.untrusted?
b.untrusted?.should == false b.should_not.untrusted?
c.untrusted?.should == false c.should_not.untrusted?
end end
it "has effect on immediate values" do it "has effect on immediate values" do

View file

@ -9,7 +9,7 @@ describe "MatchData#string" do
it "returns a frozen copy of the match string" do it "returns a frozen copy of the match string" do
str = /(.)(.)(\d+)(\d)/.match("THX1138.").string str = /(.)(.)(\d+)(\d)/.match("THX1138.").string
str.should == "THX1138." str.should == "THX1138."
str.frozen?.should == true str.should.frozen?
end end
it "returns the same frozen string for every call" do it "returns the same frozen string for every call" do
@ -20,6 +20,6 @@ describe "MatchData#string" do
it "returns a frozen copy of the matched string for gsub(String)" do it "returns a frozen copy of the matched string for gsub(String)" do
'he[[o'.gsub!('[', ']') 'he[[o'.gsub!('[', ']')
$~.string.should == 'he[[o' $~.string.should == 'he[[o'
$~.string.frozen?.should == true $~.string.should.frozen?
end end
end end

View file

@ -14,8 +14,8 @@ describe "Math.tan" do
end end
it "returns NaN if called with +-Infinity" do it "returns NaN if called with +-Infinity" do
Math.tan(infinity_value).nan?.should == true Math.tan(infinity_value).should.nan?
Math.tan(-infinity_value).nan?.should == true Math.tan(-infinity_value).should.nan?
end end
it "raises a TypeError if the argument cannot be coerced with Float()" do it "raises a TypeError if the argument cannot be coerced with Float()" do

View file

@ -39,8 +39,8 @@ ruby_version_is "2.6" do
double = proc { |x| x + x } double = proc { |x| x + x }
(pow_2 << double).is_a?(Proc).should == true (pow_2 << double).is_a?(Proc).should == true
ruby_version_is(''...'2.8') { (pow_2 << double).lambda?.should == true } ruby_version_is(''...'2.8') { (pow_2 << double).should.lambda? }
ruby_version_is('2.8') { (pow_2 << double).lambda?.should == false } ruby_version_is('2.8') { (pow_2 << double).should_not.lambda? }
end end
it "may accept multiple arguments" do it "may accept multiple arguments" do
@ -88,7 +88,7 @@ ruby_version_is "2.6" do
double = proc { |x| x + x } double = proc { |x| x + x }
(pow_2 >> double).is_a?(Proc).should == true (pow_2 >> double).is_a?(Proc).should == true
(pow_2 >> double).lambda?.should == true (pow_2 >> double).should.lambda?
end end
it "may accept multiple arguments" do it "may accept multiple arguments" do

View file

@ -39,6 +39,6 @@ describe "Module#included" do
it "works with super using a singleton class" do it "works with super using a singleton class" do
ModuleSpecs::SingletonOnModuleCase::Bar.include ModuleSpecs::SingletonOnModuleCase::Foo ModuleSpecs::SingletonOnModuleCase::Bar.include ModuleSpecs::SingletonOnModuleCase::Foo
ModuleSpecs::SingletonOnModuleCase::Bar.included_called?.should == true ModuleSpecs::SingletonOnModuleCase::Bar.should.included_called?
end end
end end

View file

@ -122,7 +122,7 @@ describe "Module#name" do
ruby_version_is "2.7" do ruby_version_is "2.7" do
it "returns a frozen String" do it "returns a frozen String" do
ModuleSpecs.name.frozen?.should == true ModuleSpecs.name.should.frozen?
end end
it "always returns the same String for a given Module" do it "always returns the same String for a given Module" do

View file

@ -3,25 +3,25 @@ require_relative '../../spec_helper'
describe "Module#singleton_class?" do describe "Module#singleton_class?" do
it "returns true for singleton classes" do it "returns true for singleton classes" do
xs = self.singleton_class xs = self.singleton_class
xs.singleton_class?.should == true xs.should.singleton_class?
end end
it "returns false for other classes" do it "returns false for other classes" do
c = Class.new c = Class.new
c.singleton_class?.should == false c.should_not.singleton_class?
end end
describe "with singleton values" do describe "with singleton values" do
it "returns false for nil's singleton class" do it "returns false for nil's singleton class" do
NilClass.singleton_class?.should == false NilClass.should_not.singleton_class?
end end
it "returns false for true's singleton class" do it "returns false for true's singleton class" do
TrueClass.singleton_class?.should == false TrueClass.should_not.singleton_class?
end end
it "returns false for false's singleton class" do it "returns false for false's singleton class" do
FalseClass.singleton_class?.should == false FalseClass.should_not.singleton_class?
end end
end end
end end

View file

@ -2,6 +2,6 @@ require_relative '../../spec_helper'
describe "NilClass#nil?" do describe "NilClass#nil?" do
it "returns true" do it "returns true" do
nil.nil?.should == true nil.should.nil?
end end
end end

View file

@ -7,7 +7,7 @@ describe "NilClass#to_s" do
ruby_version_is "2.7" do ruby_version_is "2.7" do
it "returns a frozen string" do it "returns a frozen string" do
nil.to_s.frozen?.should == true nil.to_s.should.frozen?
end end
it "always returns the same string" do it "always returns the same string" do

View file

@ -3,6 +3,6 @@ require_relative 'fixtures/classes'
describe "Numeric#integer?" do describe "Numeric#integer?" do
it "returns false" do it "returns false" do
NumericSpecs::Subclass.new.integer?.should == false NumericSpecs::Subclass.new.should_not.integer?
end end
end end

View file

@ -31,11 +31,11 @@ describe "Numeric#negative?" do
it "returns true if self is less than 0" do it "returns true if self is less than 0" do
@obj.should_receive(:<).with(0).and_return(true) @obj.should_receive(:<).with(0).and_return(true)
@obj.negative?.should == true @obj.should.negative?
end end
it "returns false if self is greater than 0" do it "returns false if self is greater than 0" do
@obj.should_receive(:<).with(0).and_return(false) @obj.should_receive(:<).with(0).and_return(false)
@obj.negative?.should == false @obj.should_not.negative?
end end
end end

View file

@ -31,11 +31,11 @@ describe "Numeric#positive?" do
it "returns true if self is greater than 0" do it "returns true if self is greater than 0" do
@obj.should_receive(:>).with(0).and_return(true) @obj.should_receive(:>).with(0).and_return(true)
@obj.positive?.should == true @obj.should.positive?
end end
it "returns false if self is less than 0" do it "returns false if self is less than 0" do
@obj.should_receive(:>).with(0).and_return(false) @obj.should_receive(:>).with(0).and_return(false)
@obj.positive?.should == false @obj.should_not.positive?
end end
end end

View file

@ -32,6 +32,6 @@ end
describe "Numeric#real?" do describe "Numeric#real?" do
it "returns true" do it "returns true" do
NumericSpecs::Subclass.new.real?.should == true NumericSpecs::Subclass.new.should.real?
end end
end end

View file

@ -8,11 +8,11 @@ describe "Numeric#zero?" do
it "returns true if self is 0" do it "returns true if self is 0" do
@obj.should_receive(:==).with(0).and_return(true) @obj.should_receive(:==).with(0).and_return(true)
@obj.zero?.should == true @obj.should.zero?
end end
it "returns false if self is not 0" do it "returns false if self is not 0" do
@obj.should_receive(:==).with(0).and_return(false) @obj.should_receive(:==).with(0).and_return(false)
@obj.zero?.should == false @obj.should_not.zero?
end end
end end

View file

@ -35,7 +35,7 @@ ruby_version_is "2.6" do
g = proc { |x| x + x } g = proc { |x| x + x }
(f << g).is_a?(Proc).should == true (f << g).is_a?(Proc).should == true
(f << g).lambda?.should == false (f << g).should_not.lambda?
end end
ruby_version_is(''...'2.8') do ruby_version_is(''...'2.8') do
@ -44,7 +44,7 @@ ruby_version_is "2.6" do
g = -> x { x + x } g = -> x { x + x }
(f << g).is_a?(Proc).should == true (f << g).is_a?(Proc).should == true
(f << g).lambda?.should == false (f << g).should_not.lambda?
end end
it "is a lambda when self is lambda" do it "is a lambda when self is lambda" do
@ -52,7 +52,7 @@ ruby_version_is "2.6" do
g = proc { |x| x + x } g = proc { |x| x + x }
(f << g).is_a?(Proc).should == true (f << g).is_a?(Proc).should == true
(f << g).lambda?.should == true (f << g).should.lambda?
end end
end end
@ -63,8 +63,8 @@ ruby_version_is "2.6" do
lambda_proc = -> x { x } lambda_proc = -> x { x }
(f << g).is_a?(Proc).should == true (f << g).is_a?(Proc).should == true
(f << g).lambda?.should == false (f << g).should_not.lambda?
(f << lambda_proc).lambda?.should == true (f << lambda_proc).should.lambda?
end end
end end
@ -118,7 +118,7 @@ ruby_version_is "2.6" do
g = proc { |x| x + x } g = proc { |x| x + x }
(f >> g).is_a?(Proc).should == true (f >> g).is_a?(Proc).should == true
(f >> g).lambda?.should == false (f >> g).should_not.lambda?
end end
it "is a Proc when other is lambda" do it "is a Proc when other is lambda" do
@ -126,7 +126,7 @@ ruby_version_is "2.6" do
g = -> x { x + x } g = -> x { x + x }
(f >> g).is_a?(Proc).should == true (f >> g).is_a?(Proc).should == true
(f >> g).lambda?.should == false (f >> g).should_not.lambda?
end end
it "is a lambda when self is lambda" do it "is a lambda when self is lambda" do
@ -134,7 +134,7 @@ ruby_version_is "2.6" do
g = proc { |x| x + x } g = proc { |x| x + x }
(f >> g).is_a?(Proc).should == true (f >> g).is_a?(Proc).should == true
(f >> g).lambda?.should == true (f >> g).should.lambda?
end end
it "may accept multiple arguments" do it "may accept multiple arguments" do

View file

@ -5,11 +5,11 @@ describe "Range#dup" do
copy = (1..3).dup copy = (1..3).dup
copy.begin.should == 1 copy.begin.should == 1
copy.end.should == 3 copy.end.should == 3
copy.exclude_end?.should == false copy.should_not.exclude_end?
copy = ("a"..."z").dup copy = ("a"..."z").dup
copy.begin.should == "a" copy.begin.should == "a"
copy.end.should == "z" copy.end.should == "z"
copy.exclude_end?.should == true copy.should.exclude_end?
end end
end end

View file

@ -2,18 +2,18 @@ require_relative '../../spec_helper'
describe "Range#exclude_end?" do describe "Range#exclude_end?" do
it "returns false if the range does not exclude the end value" do it "returns false if the range does not exclude the end value" do
(-2..2).exclude_end?.should == false (-2..2).should_not.exclude_end?
('A'..'B').exclude_end?.should == false ('A'..'B').should_not.exclude_end?
(0.5..2.4).exclude_end?.should == false (0.5..2.4).should_not.exclude_end?
(0xfffd..0xffff).exclude_end?.should == false (0xfffd..0xffff).should_not.exclude_end?
Range.new(0, 1).exclude_end?.should == false Range.new(0, 1).should_not.exclude_end?
end end
it "returns true if the range excludes the end value" do it "returns true if the range excludes the end value" do
(0...5).exclude_end?.should == true (0...5).should.exclude_end?
('A'...'B').exclude_end?.should == true ('A'...'B').should.exclude_end?
(0.5...2.4).exclude_end?.should == true (0.5...2.4).should.exclude_end?
(0xfffd...0xffff).exclude_end?.should == true (0xfffd...0xffff).should.exclude_end?
Range.new(0, 1, true).exclude_end?.should == true Range.new(0, 1, true).should.exclude_end?
end end
end end

View file

@ -2,7 +2,7 @@ require_relative '../../spec_helper'
describe "Regexp#casefold?" do describe "Regexp#casefold?" do
it "returns the value of the case-insensitive flag" do it "returns the value of the case-insensitive flag" do
/abc/i.casefold?.should == true /abc/i.should.casefold?
/xyz/.casefold?.should == false /xyz/.should_not.casefold?
end end
end end

Some files were not shown because too many files have changed in this diff Show more