From 5aaa75e7c1f4b7912c10ffdcb1cac581e20eda39 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sun, 3 May 2020 12:28:29 +0200 Subject: [PATCH] Update to ruby/spec@032ee74 --- spec/ruby/command_line/error_message_spec.rb | 4 +- spec/ruby/core/argf/binmode_spec.rb | 2 +- spec/ruby/core/array/any_spec.rb | 6 +-- spec/ruby/core/array/clear_spec.rb | 2 +- spec/ruby/core/array/clone_spec.rb | 4 +- spec/ruby/core/array/empty_spec.rb | 6 +-- spec/ruby/core/array/frozen_spec.rb | 6 +-- spec/ruby/core/array/multiply_spec.rb | 16 +++--- spec/ruby/core/array/shared/clone.rb | 8 +-- spec/ruby/core/array/sort_spec.rb | 10 ++-- spec/ruby/core/array/uniq_spec.rb | 8 +-- spec/ruby/core/class/allocate_spec.rb | 2 +- spec/ruby/core/class/new_spec.rb | 2 +- spec/ruby/core/complex/finite_spec.rb | 12 ++--- spec/ruby/core/dir/glob_spec.rb | 2 +- spec/ruby/core/dir/home_spec.rb | 4 +- spec/ruby/core/dir/shared/open.rb | 2 +- spec/ruby/core/enumerable/all_spec.rb | 30 +++++------ spec/ruby/core/enumerable/any_spec.rb | 36 ++++++------- spec/ruby/core/enumerable/none_spec.rb | 2 +- spec/ruby/core/enumerable/one_spec.rb | 2 +- spec/ruby/core/enumerable/uniq_spec.rb | 8 +-- .../arithmetic_sequence/exclude_end_spec.rb | 8 +-- spec/ruby/core/env/element_reference_spec.rb | 2 +- spec/ruby/core/env/empty_spec.rb | 6 +-- spec/ruby/core/env/shift_spec.rb | 2 +- spec/ruby/core/exception/success_spec.rb | 4 +- spec/ruby/core/false/to_s_spec.rb | 2 +- spec/ruby/core/file/expand_path_spec.rb | 6 +-- spec/ruby/core/file/lchmod_spec.rb | 12 ++--- spec/ruby/core/file/lstat_spec.rb | 4 +- spec/ruby/core/file/open_spec.rb | 8 +-- spec/ruby/core/file/stat/owned_spec.rb | 4 +- spec/ruby/core/file/stat/pipe_spec.rb | 4 +- spec/ruby/core/file/stat_spec.rb | 8 +-- spec/ruby/core/file/truncate_spec.rb | 6 +-- spec/ruby/core/float/finite_spec.rb | 8 +-- spec/ruby/core/float/nan_spec.rb | 6 +-- spec/ruby/core/float/next_float_spec.rb | 2 +- spec/ruby/core/float/prev_float_spec.rb | 2 +- spec/ruby/core/float/uminus_spec.rb | 2 +- spec/ruby/core/float/zero_spec.rb | 6 +-- spec/ruby/core/gc/profiler/disable_spec.rb | 2 +- spec/ruby/core/gc/profiler/enable_spec.rb | 2 +- spec/ruby/core/hash/any_spec.rb | 4 +- .../core/hash/compare_by_identity_spec.rb | 2 +- spec/ruby/core/hash/empty_spec.rb | 10 ++-- spec/ruby/core/hash/reject_spec.rb | 2 +- spec/ruby/core/hash/shared/store.rb | 2 +- spec/ruby/core/hash/to_proc_spec.rb | 4 +- spec/ruby/core/integer/integer_spec.rb | 6 +-- spec/ruby/core/io/close_on_exec_spec.rb | 12 ++--- spec/ruby/core/io/close_read_spec.rb | 2 +- spec/ruby/core/io/close_spec.rb | 2 +- spec/ruby/core/io/close_write_spec.rb | 2 +- spec/ruby/core/io/dup_spec.rb | 12 ++--- spec/ruby/core/io/eof_spec.rb | 26 +++++----- spec/ruby/core/io/gets_spec.rb | 8 +-- spec/ruby/core/io/pipe_spec.rb | 12 ++--- spec/ruby/core/io/popen_spec.rb | 4 +- spec/ruby/core/io/read_nonblock_spec.rb | 2 +- spec/ruby/core/io/read_spec.rb | 2 +- spec/ruby/core/io/reopen_spec.rb | 8 +-- spec/ruby/core/io/rewind_spec.rb | 2 +- spec/ruby/core/io/seek_spec.rb | 6 +-- spec/ruby/core/io/shared/new.rb | 12 ++--- spec/ruby/core/io/shared/pos.rb | 2 +- spec/ruby/core/io/ungetc_spec.rb | 4 +- spec/ruby/core/io/write_nonblock_spec.rb | 2 +- spec/ruby/core/kernel/backtick_spec.rb | 24 ++++----- .../ruby/core/kernel/caller_locations_spec.rb | 2 +- spec/ruby/core/kernel/caller_spec.rb | 2 +- spec/ruby/core/kernel/clone_spec.rb | 12 ++--- spec/ruby/core/kernel/dup_spec.rb | 2 +- spec/ruby/core/kernel/frozen_spec.rb | 4 +- spec/ruby/core/kernel/shared/dup_clone.rb | 8 +-- spec/ruby/core/kernel/system_spec.rb | 6 +-- spec/ruby/core/kernel/taint_spec.rb | 8 +-- spec/ruby/core/kernel/tainted_spec.rb | 4 +- spec/ruby/core/kernel/trust_spec.rb | 2 +- spec/ruby/core/kernel/untaint_spec.rb | 2 +- spec/ruby/core/kernel/untrust_spec.rb | 2 +- spec/ruby/core/kernel/untrusted_spec.rb | 10 ++-- spec/ruby/core/matchdata/string_spec.rb | 4 +- spec/ruby/core/math/tan_spec.rb | 4 +- spec/ruby/core/method/compose_spec.rb | 6 +-- spec/ruby/core/module/included_spec.rb | 2 +- spec/ruby/core/module/name_spec.rb | 2 +- spec/ruby/core/module/singleton_class_spec.rb | 10 ++-- spec/ruby/core/nil/nil_spec.rb | 2 +- spec/ruby/core/nil/to_s_spec.rb | 2 +- spec/ruby/core/numeric/integer_spec.rb | 2 +- spec/ruby/core/numeric/negative_spec.rb | 4 +- spec/ruby/core/numeric/positive_spec.rb | 4 +- spec/ruby/core/numeric/real_spec.rb | 2 +- spec/ruby/core/numeric/zero_spec.rb | 4 +- spec/ruby/core/proc/compose_spec.rb | 16 +++--- spec/ruby/core/range/dup_spec.rb | 4 +- spec/ruby/core/range/exclude_end_spec.rb | 20 +++---- spec/ruby/core/regexp/casefold_spec.rb | 4 +- spec/ruby/core/signal/trap_spec.rb | 2 +- spec/ruby/core/string/capitalize_spec.rb | 4 +- spec/ruby/core/string/center_spec.rb | 10 ++-- spec/ruby/core/string/chop_spec.rb | 8 +-- spec/ruby/core/string/crypt_spec.rb | 16 +++--- spec/ruby/core/string/delete_prefix_spec.rb | 4 +- spec/ruby/core/string/delete_spec.rb | 6 +-- spec/ruby/core/string/delete_suffix_spec.rb | 4 +- spec/ruby/core/string/downcase_spec.rb | 6 +-- spec/ruby/core/string/dump_spec.rb | 10 ++-- spec/ruby/core/string/element_set_spec.rb | 8 +-- spec/ruby/core/string/empty_spec.rb | 10 ++-- spec/ruby/core/string/gsub_spec.rb | 52 +++++++++---------- spec/ruby/core/string/insert_spec.rb | 4 +- spec/ruby/core/string/inspect_spec.rb | 8 +-- spec/ruby/core/string/ljust_spec.rb | 10 ++-- spec/ruby/core/string/lstrip_spec.rb | 6 +-- spec/ruby/core/string/modulo_spec.rb | 14 ++--- spec/ruby/core/string/reverse_spec.rb | 4 +- spec/ruby/core/string/rjust_spec.rb | 10 ++-- spec/ruby/core/string/rstrip_spec.rb | 6 +-- spec/ruby/core/string/shared/chars.rb | 4 +- spec/ruby/core/string/shared/concat.rb | 8 +-- spec/ruby/core/string/shared/each_line.rb | 4 +- spec/ruby/core/string/shared/replace.rb | 8 +-- spec/ruby/core/string/shared/slice.rb | 26 +++++----- spec/ruby/core/string/shared/succ.rb | 2 +- spec/ruby/core/string/shared/to_s.rb | 4 +- spec/ruby/core/string/shared/to_sym.rb | 2 +- spec/ruby/core/string/slice_spec.rb | 16 +++--- spec/ruby/core/string/split_spec.rb | 4 +- spec/ruby/core/string/squeeze_spec.rb | 8 +-- spec/ruby/core/string/strip_spec.rb | 6 +-- spec/ruby/core/string/sub_spec.rb | 32 ++++++------ spec/ruby/core/string/swapcase_spec.rb | 4 +- spec/ruby/core/string/tr_s_spec.rb | 6 +-- spec/ruby/core/string/tr_spec.rb | 6 +-- spec/ruby/core/string/uminus_spec.rb | 4 +- spec/ruby/core/string/undump_spec.rb | 6 +-- .../core/string/unicode_normalized_spec.rb | 8 +-- spec/ruby/core/string/upcase_spec.rb | 6 +-- spec/ruby/core/string/uplus_spec.rb | 2 +- spec/ruby/core/symbol/to_proc_spec.rb | 4 +- spec/ruby/core/systemexit/success_spec.rb | 4 +- spec/ruby/core/thread/alive_spec.rb | 20 +++---- spec/ruby/core/thread/new_spec.rb | 12 ++--- spec/ruby/core/thread/stop_spec.rb | 20 +++---- spec/ruby/core/time/_dump_spec.rb | 4 +- spec/ruby/core/time/at_spec.rb | 6 +-- spec/ruby/core/time/dup_spec.rb | 4 +- spec/ruby/core/time/friday_spec.rb | 4 +- spec/ruby/core/time/gmt_spec.rb | 4 +- spec/ruby/core/time/minus_spec.rb | 4 +- spec/ruby/core/time/monday_spec.rb | 4 +- spec/ruby/core/time/new_spec.rb | 2 +- spec/ruby/core/time/plus_spec.rb | 4 +- spec/ruby/core/time/saturday_spec.rb | 4 +- spec/ruby/core/time/sunday_spec.rb | 4 +- spec/ruby/core/time/thursday_spec.rb | 4 +- spec/ruby/core/time/tuesday_spec.rb | 4 +- spec/ruby/core/time/utc_spec.rb | 2 +- spec/ruby/core/time/wednesday_spec.rb | 4 +- spec/ruby/core/tracepoint/disable_spec.rb | 6 +-- spec/ruby/core/tracepoint/enable_spec.rb | 4 +- spec/ruby/core/tracepoint/enabled_spec.rb | 4 +- spec/ruby/core/tracepoint/trace_spec.rb | 2 +- spec/ruby/core/true/to_s_spec.rb | 2 +- spec/ruby/language/hash_spec.rb | 2 +- spec/ruby/language/predefined_spec.rb | 4 +- spec/ruby/language/regexp/encoding_spec.rb | 4 +- spec/ruby/language/regexp_spec.rb | 2 +- spec/ruby/language/variables_spec.rb | 2 +- .../library/bigdecimal/BigDecimal_spec.rb | 20 +++---- spec/ruby/library/bigdecimal/abs_spec.rb | 2 +- spec/ruby/library/bigdecimal/add_spec.rb | 8 +-- spec/ruby/library/bigdecimal/div_spec.rb | 16 +++--- spec/ruby/library/bigdecimal/divmod_spec.rb | 6 +-- spec/ruby/library/bigdecimal/finite_spec.rb | 8 +-- spec/ruby/library/bigdecimal/fix_spec.rb | 2 +- spec/ruby/library/bigdecimal/frac_spec.rb | 2 +- spec/ruby/library/bigdecimal/minus_spec.rb | 18 +++---- spec/ruby/library/bigdecimal/mode_spec.rb | 2 +- spec/ruby/library/bigdecimal/nan_spec.rb | 22 ++++---- spec/ruby/library/bigdecimal/plus_spec.rb | 6 +-- spec/ruby/library/bigdecimal/quo_spec.rb | 4 +- .../ruby/library/bigdecimal/remainder_spec.rb | 38 +++++++------- spec/ruby/library/bigdecimal/shared/modulo.rb | 28 +++++----- spec/ruby/library/bigdecimal/shared/mult.rb | 20 +++---- spec/ruby/library/bigdecimal/shared/power.rb | 4 +- spec/ruby/library/bigdecimal/shared/quo.rb | 10 ++-- spec/ruby/library/bigdecimal/sub_spec.rb | 8 +-- spec/ruby/library/bigdecimal/to_f_spec.rb | 2 +- spec/ruby/library/bigdecimal/truncate_spec.rb | 6 +-- spec/ruby/library/bigdecimal/uminus_spec.rb | 2 +- spec/ruby/library/bigdecimal/zero_spec.rb | 26 +++++----- .../library/conditionvariable/signal_spec.rb | 2 +- spec/ruby/library/csv/liberal_parsing_spec.rb | 6 +-- spec/ruby/library/date/gregorian_spec.rb | 2 +- spec/ruby/library/date/infinity_spec.rb | 14 ++--- spec/ruby/library/date/julian_spec.rb | 4 +- spec/ruby/library/date/shared/civil.rb | 8 +-- .../library/getoptlong/terminated_spec.rb | 6 +-- .../library/ipaddr/ipv4_conversion_spec.rb | 8 +-- spec/ruby/library/ipaddr/new_spec.rb | 8 +-- spec/ruby/library/logger/logger/debug_spec.rb | 4 +- spec/ruby/library/logger/logger/error_spec.rb | 4 +- spec/ruby/library/logger/logger/fatal_spec.rb | 4 +- spec/ruby/library/logger/logger/info_spec.rb | 4 +- spec/ruby/library/logger/logger/warn_spec.rb | 4 +- spec/ruby/library/matrix/normal_spec.rb | 6 +-- spec/ruby/library/matrix/orthogonal_spec.rb | 6 +-- spec/ruby/library/matrix/unitary_spec.rb | 10 ++-- spec/ruby/library/matrix/zero_spec.rb | 10 ++-- .../http/httpresponse/body_permitted_spec.rb | 12 ++--- spec/ruby/library/pathname/absolute_spec.rb | 8 +-- spec/ruby/library/pathname/new_spec.rb | 2 +- spec/ruby/library/pathname/relative_spec.rb | 8 +-- spec/ruby/library/pathname/root_spec.rb | 10 ++-- .../ruby/library/rexml/element/cdatas_spec.rb | 2 +- .../library/rexml/element/comments_spec.rb | 2 +- spec/ruby/library/rexml/node/parent_spec.rb | 6 +-- spec/ruby/library/rexml/text/empty_spec.rb | 4 +- .../library/set/compare_by_identity_spec.rb | 12 ++--- .../socket/addrinfo/ipv4_loopback_spec.rb | 8 +-- .../socket/addrinfo/ipv4_multicast_spec.rb | 10 ++-- .../socket/addrinfo/ipv4_private_spec.rb | 12 ++--- .../socket/addrinfo/ipv6_linklocal_spec.rb | 12 ++--- .../socket/addrinfo/ipv6_mc_global_spec.rb | 16 +++--- .../socket/addrinfo/ipv6_mc_linklocal_spec.rb | 14 ++--- .../socket/addrinfo/ipv6_mc_nodelocal_spec.rb | 12 ++--- .../socket/addrinfo/ipv6_mc_orglocal_spec.rb | 12 ++--- .../socket/addrinfo/ipv6_mc_sitelocal_spec.rb | 12 ++--- .../socket/addrinfo/ipv6_multicast_spec.rb | 18 +++---- .../socket/addrinfo/ipv6_sitelocal_spec.rb | 12 ++--- .../socket/addrinfo/ipv6_unique_local_spec.rb | 12 ++--- .../socket/addrinfo/ipv6_unspecified_spec.rb | 6 +-- .../socket/addrinfo/ipv6_v4compat_spec.rb | 10 ++-- .../socket/addrinfo/ipv6_v4mapped_spec.rb | 10 ++-- .../library/socket/addrinfo/listen_spec.rb | 2 +- .../socket/basicsocket/read_nonblock_spec.rb | 8 +-- .../socket/basicsocket/write_nonblock_spec.rb | 8 +-- .../socket/socket/tcp_server_sockets_spec.rb | 2 +- spec/ruby/library/socket/socket/tcp_spec.rb | 2 +- .../socket/socket/udp_server_sockets_spec.rb | 2 +- spec/ruby/library/socket/socket/unix_spec.rb | 2 +- .../library/socket/unixsocket/open_spec.rb | 2 +- .../library/socket/unixsocket/shared/new.rb | 2 +- spec/ruby/library/stringio/reopen_spec.rb | 2 +- spec/ruby/library/syslog/close_spec.rb | 2 +- spec/ruby/library/syslog/ident_spec.rb | 2 +- spec/ruby/library/syslog/mask_spec.rb | 2 +- .../library/weakref/weakref_alive_spec.rb | 2 +- .../win32ole/win32ole_param/input_spec.rb | 2 +- spec/ruby/library/zlib/gzipfile/close_spec.rb | 2 +- .../ruby/library/zlib/gzipfile/closed_spec.rb | 4 +- .../zlib/zstream/flush_next_out_spec.rb | 2 +- spec/ruby/optional/capi/kernel_spec.rb | 10 ++-- spec/ruby/optional/capi/object_spec.rb | 4 +- spec/ruby/optional/capi/shared/rbasic.rb | 12 ++--- spec/ruby/optional/capi/string_spec.rb | 10 ++-- spec/ruby/optional/capi/tracepoint_spec.rb | 12 ++--- spec/ruby/security/cve_2020_10663_spec.rb | 2 +- spec/ruby/shared/string/times.rb | 2 +- 263 files changed, 921 insertions(+), 921 deletions(-) diff --git a/spec/ruby/command_line/error_message_spec.rb b/spec/ruby/command_line/error_message_spec.rb index 5fee3ead44..f3f7de4fd4 100644 --- a/spec/ruby/command_line/error_message_spec.rb +++ b/spec/ruby/command_line/error_message_spec.rb @@ -3,9 +3,9 @@ require_relative '../spec_helper' describe "The error message caused by an exception" do it "is not printed to stdout" do 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.chomp.empty?.should == true + out.chomp.should.empty? end end diff --git a/spec/ruby/core/argf/binmode_spec.rb b/spec/ruby/core/argf/binmode_spec.rb index bdcc6aa30a..e083a30a27 100644 --- a/spec/ruby/core/argf/binmode_spec.rb +++ b/spec/ruby/core/argf/binmode_spec.rb @@ -34,7 +34,7 @@ describe "ARGF.binmode" do it "sets the file's encoding to BINARY" do argf [@bin_file, @file1] do @argf.binmode - @argf.binmode?.should == true + @argf.should.binmode? @argf.gets.encoding.should == Encoding::BINARY @argf.skip @argf.read.encoding.should == Encoding::BINARY diff --git a/spec/ruby/core/array/any_spec.rb b/spec/ruby/core/array/any_spec.rb index 2fa5353e99..09d949fe6e 100644 --- a/spec/ruby/core/array/any_spec.rb +++ b/spec/ruby/core/array/any_spec.rb @@ -4,17 +4,17 @@ describe "Array#any?" do describe 'with no block given (a default block of { |x| x } is implicit)' do it "is false if the array is empty" do empty_array = [] - empty_array.any?.should == false + empty_array.should_not.any? end 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.any?.should == false + falsy_array.should_not.any? end it "is true if the array has any truthy members" do not_empty_array = ['anything', nil] - not_empty_array.any?.should == true + not_empty_array.should.any? end end diff --git a/spec/ruby/core/array/clear_spec.rb b/spec/ruby/core/array/clear_spec.rb index 5c7a934d75..bddc672d3b 100644 --- a/spec/ruby/core/array/clear_spec.rb +++ b/spec/ruby/core/array/clear_spec.rb @@ -16,7 +16,7 @@ describe "Array#clear" do it "leaves the Array empty" do a = [1] a.clear - a.empty?.should == true + a.should.empty? a.size.should == 0 end diff --git a/spec/ruby/core/array/clone_spec.rb b/spec/ruby/core/array/clone_spec.rb index 803e746e02..e22a6c6d53 100644 --- a/spec/ruby/core/array/clone_spec.rb +++ b/spec/ruby/core/array/clone_spec.rb @@ -12,8 +12,8 @@ describe "Array#clone" do aa = a.clone bb = b.clone - aa.frozen?.should == true - bb.frozen?.should == false + aa.should.frozen? + bb.should_not.frozen? end it "copies singleton methods" do diff --git a/spec/ruby/core/array/empty_spec.rb b/spec/ruby/core/array/empty_spec.rb index b5f3e8ed48..f70b1b6ebe 100644 --- a/spec/ruby/core/array/empty_spec.rb +++ b/spec/ruby/core/array/empty_spec.rb @@ -3,8 +3,8 @@ require_relative 'fixtures/classes' describe "Array#empty?" do it "returns true if the array has no elements" do - [].empty?.should == true - [1].empty?.should == false - [1, 2].empty?.should == false + [].should.empty? + [1].should_not.empty? + [1, 2].should_not.empty? end end diff --git a/spec/ruby/core/array/frozen_spec.rb b/spec/ruby/core/array/frozen_spec.rb index bb4b2b4067..3ba54be46b 100644 --- a/spec/ruby/core/array/frozen_spec.rb +++ b/spec/ruby/core/array/frozen_spec.rb @@ -4,13 +4,13 @@ require_relative 'fixtures/classes' describe "Array#frozen?" do it "returns true if array is frozen" do a = [1, 2, 3] - a.frozen?.should == false + a.should_not.frozen? a.freeze - a.frozen?.should == true + a.should.frozen? end it "returns false for an array being sorted by #sort" do 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 diff --git a/spec/ruby/core/array/multiply_spec.rb b/spec/ruby/core/array/multiply_spec.rb index 4060666d4b..8ccec13d42 100644 --- a/spec/ruby/core/array/multiply_spec.rb +++ b/spec/ruby/core/array/multiply_spec.rb @@ -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 ary = [1, 2, 3] ary.taint - (ary * 0).tainted?.should == true + (ary * 0).should.tainted? end it "copies the taint status of the original array even if the array is empty" do ary = [] ary.taint - (ary * 3).tainted?.should == true + (ary * 3).should.tainted? end it "copies the taint status of the original array if the passed count is not 0" do ary = [1, 2, 3] ary.taint - (ary * 1).tainted?.should == true - (ary * 2).tainted?.should == true + (ary * 1).should.tainted? + (ary * 2).should.tainted? end it "copies the untrusted status of the original array even if the passed count is 0" do ary = [1, 2, 3] ary.untrust - (ary * 0).untrusted?.should == true + (ary * 0).should.untrusted? end it "copies the untrusted status of the original array even if the array is empty" do ary = [] ary.untrust - (ary * 3).untrusted?.should == true + (ary * 3).should.untrusted? end it "copies the untrusted status of the original array if the passed count is not 0" do ary = [1, 2, 3] ary.untrust - (ary * 1).untrusted?.should == true - (ary * 2).untrusted?.should == true + (ary * 1).should.untrusted? + (ary * 2).should.untrusted? end end end diff --git a/spec/ruby/core/array/shared/clone.rb b/spec/ruby/core/array/shared/clone.rb index f6f581b17c..3c17b1f10f 100644 --- a/spec/ruby/core/array/shared/clone.rb +++ b/spec/ruby/core/array/shared/clone.rb @@ -26,8 +26,8 @@ describe :array_clone, shared: true do aa = a.send @method bb = b.send @method - aa.tainted?.should == true - bb.tainted?.should == false + aa.should.tainted? + bb.should_not.tainted? end it "copies untrusted status from the original" do @@ -37,8 +37,8 @@ describe :array_clone, shared: true do aa = a.send @method bb = b.send @method - aa.untrusted?.should == true - bb.untrusted?.should == false + aa.should.untrusted? + bb.should_not.untrusted? end end end diff --git a/spec/ruby/core/array/sort_spec.rb b/spec/ruby/core/array/sort_spec.rb index 541f3a5964..0c5ecdcbbf 100644 --- a/spec/ruby/core/array/sort_spec.rb +++ b/spec/ruby/core/array/sort_spec.rb @@ -58,9 +58,9 @@ describe "Array#sort" do b = 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] - ArraySpecs::MockForCompared.compared?.should == true + ArraySpecs::MockForCompared.should.compared? end 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 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 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 c = ArraySpecs::MockForCompared.new - ArraySpecs::MockForCompared.compared?.should == false + ArraySpecs::MockForCompared.should_not.compared? [a, b, c].sort!.should == [c, b, a] - ArraySpecs::MockForCompared.compared?.should == true + ArraySpecs::MockForCompared.should.compared? end it "does not call #<=> on contained objects when invoked with a block" do diff --git a/spec/ruby/core/array/uniq_spec.rb b/spec/ruby/core/array/uniq_spec.rb index 38e1878f10..fd604987c1 100644 --- a/spec/ruby/core/array/uniq_spec.rb +++ b/spec/ruby/core/array/uniq_spec.rb @@ -87,8 +87,8 @@ describe "Array#uniq" do end a.uniq.should == a - a[0].tainted?.should == true - a[1].tainted?.should == true + a[0].should.tainted? + a[1].should.tainted? a = Array.new(2) do obj = mock('0') @@ -106,8 +106,8 @@ describe "Array#uniq" do end a.uniq.size.should == 1 - a[0].tainted?.should == true - a[1].tainted?.should == true + a[0].should.tainted? + a[1].should.tainted? end end diff --git a/spec/ruby/core/class/allocate_spec.rb b/spec/ruby/core/class/allocate_spec.rb index c426c38ff9..b39622e06a 100644 --- a/spec/ruby/core/class/allocate_spec.rb +++ b/spec/ruby/core/class/allocate_spec.rb @@ -30,7 +30,7 @@ describe "Class#allocate" do end end - klass.allocate.initialized?.should == false + klass.allocate.should_not.initialized? end it "raises TypeError for #superclass" do diff --git a/spec/ruby/core/class/new_spec.rb b/spec/ruby/core/class/new_spec.rb index 8191ce6a37..989d674558 100644 --- a/spec/ruby/core/class/new_spec.rb +++ b/spec/ruby/core/class/new_spec.rb @@ -126,7 +126,7 @@ describe "Class#new" do end end - klass.new.initialized?.should == true + klass.new.should.initialized? klass.new(1, 2, 3).args.should == [1, 2, 3] end diff --git a/spec/ruby/core/complex/finite_spec.rb b/spec/ruby/core/complex/finite_spec.rb index 718848390c..7d9f82404e 100644 --- a/spec/ruby/core/complex/finite_spec.rb +++ b/spec/ruby/core/complex/finite_spec.rb @@ -2,31 +2,31 @@ require_relative '../../spec_helper' describe "Complex#finite?" do it "returns true if magnitude is finite" do - (1+1i).finite?.should == true + (1+1i).should.finite? end it "returns false for positive infinity" do value = Complex(Float::INFINITY, 42) - value.finite?.should == false + value.should_not.finite? end it "returns false for positive complex with infinite imaginary" do value = Complex(1, Float::INFINITY) - value.finite?.should == false + value.should_not.finite? end it "returns false for negative infinity" do value = -Complex(Float::INFINITY, 42) - value.finite?.should == false + value.should_not.finite? end it "returns false for negative complex with infinite imaginary" do value = -Complex(1, Float::INFINITY) - value.finite?.should == false + value.should_not.finite? end it "returns false for NaN" do value = Complex(Float::NAN, Float::NAN) - value.finite?.should == false + value.should_not.finite? end end diff --git a/spec/ruby/core/dir/glob_spec.rb b/spec/ruby/core/dir/glob_spec.rb index 4b437b0e24..d4888ee147 100644 --- a/spec/ruby/core/dir/glob_spec.rb +++ b/spec/ruby/core/dir/glob_spec.rb @@ -119,7 +119,7 @@ describe "Dir.glob" do end it "handles infinite directory wildcards" do - Dir.glob('**/**/**').empty?.should == false + Dir.glob('**/**/**').should_not.empty? end it "handles simple filename patterns" do diff --git a/spec/ruby/core/dir/home_spec.rb b/spec/ruby/core/dir/home_spec.rb index 73deca2cfd..713ba9db9a 100644 --- a/spec/ruby/core/dir/home_spec.rb +++ b/spec/ruby/core/dir/home_spec.rb @@ -17,7 +17,7 @@ describe "Dir.home" do end it "returns a non-frozen string" do - Dir.home.frozen?.should == false + Dir.home.should_not.frozen? end end @@ -35,7 +35,7 @@ describe "Dir.home" do end it "returns a non-frozen string" do - Dir.home(ENV['USER']).frozen?.should == false + Dir.home(ENV['USER']).should_not.frozen? end end diff --git a/spec/ruby/core/dir/shared/open.rb b/spec/ruby/core/dir/shared/open.rb index 76b08dc288..920845cba1 100644 --- a/spec/ruby/core/dir/shared/open.rb +++ b/spec/ruby/core/dir/shared/open.rb @@ -66,7 +66,7 @@ describe :dir_open, shared: true do Dir.send(@method, DirSpecs.mock_dir) do |dir| io = IO.for_fd(dir.fileno) io.autoclose = false - io.close_on_exec?.should == true + io.should.close_on_exec? end end end diff --git a/spec/ruby/core/enumerable/all_spec.rb b/spec/ruby/core/enumerable/all_spec.rb index ae255c662c..7e9726fe87 100644 --- a/spec/ruby/core/enumerable/all_spec.rb +++ b/spec/ruby/core/enumerable/all_spec.rb @@ -10,13 +10,13 @@ describe "Enumerable#all?" do end it "always returns true on empty enumeration" do - @empty.all?.should == true + @empty.should.all? @empty.all? { nil }.should == true - [].all?.should == true + [].should.all? [].all? { false }.should == true - {}.all?.should == true + {}.should.all? {}.all? { nil }.should == true end @@ -38,24 +38,24 @@ describe "Enumerable#all?" do describe "with no block" do it "returns true if no elements are false or nil" do - @enum.all?.should == true - @enum1.all?.should == true - @enum2.all?.should == false + @enum.should.all? + @enum1.should.all? + @enum2.should_not.all? - EnumerableSpecs::Numerous.new('a','b','c').all?.should == true - EnumerableSpecs::Numerous.new(0, "x", true).all?.should == true + EnumerableSpecs::Numerous.new('a','b','c').should.all? + EnumerableSpecs::Numerous.new(0, "x", true).should.all? end it "returns false if there are false or nil elements" do - EnumerableSpecs::Numerous.new(false).all?.should == false - EnumerableSpecs::Numerous.new(false, false).all?.should == false + EnumerableSpecs::Numerous.new(false).should_not.all? + EnumerableSpecs::Numerous.new(false, false).should_not.all? - EnumerableSpecs::Numerous.new(nil).all?.should == false - EnumerableSpecs::Numerous.new(nil, nil).all?.should == false + EnumerableSpecs::Numerous.new(nil).should_not.all? + EnumerableSpecs::Numerous.new(nil, nil).should_not.all? - EnumerableSpecs::Numerous.new(1, nil, 2).all?.should == false - EnumerableSpecs::Numerous.new(0, "x", false, true).all?.should == false - @enum2.all?.should == false + EnumerableSpecs::Numerous.new(1, nil, 2).should_not.all? + EnumerableSpecs::Numerous.new(0, "x", false, true).should_not.all? + @enum2.should_not.all? end it "gathers whole arrays as elements when each yields multiple" do diff --git a/spec/ruby/core/enumerable/any_spec.rb b/spec/ruby/core/enumerable/any_spec.rb index 0202506d10..64e3159963 100644 --- a/spec/ruby/core/enumerable/any_spec.rb +++ b/spec/ruby/core/enumerable/any_spec.rb @@ -10,13 +10,13 @@ describe "Enumerable#any?" do end it "always returns false on empty enumeration" do - @empty.any?.should == false + @empty.should_not.any? @empty.any? { nil }.should == false - [].any?.should == false + [].should_not.any? [].any? { false }.should == false - {}.any?.should == false + {}.should_not.any? {}.any? { nil }.should == false end @@ -38,24 +38,24 @@ describe "Enumerable#any?" do describe "with no block" do it "returns true if any element is not false or nil" do - @enum.any?.should == true - @enum1.any?.should == true - @enum2.any?.should == true - EnumerableSpecs::Numerous.new(true).any?.should == true - EnumerableSpecs::Numerous.new('a','b','c').any?.should == true - EnumerableSpecs::Numerous.new('a','b','c', nil).any?.should == true - EnumerableSpecs::Numerous.new(1, nil, 2).any?.should == true - EnumerableSpecs::Numerous.new(1, false).any?.should == true - EnumerableSpecs::Numerous.new(false, nil, 1, false).any?.should == true - EnumerableSpecs::Numerous.new(false, 0, nil).any?.should == true + @enum.should.any? + @enum1.should.any? + @enum2.should.any? + EnumerableSpecs::Numerous.new(true).should.any? + EnumerableSpecs::Numerous.new('a','b','c').should.any? + EnumerableSpecs::Numerous.new('a','b','c', nil).should.any? + EnumerableSpecs::Numerous.new(1, nil, 2).should.any? + EnumerableSpecs::Numerous.new(1, false).should.any? + EnumerableSpecs::Numerous.new(false, nil, 1, false).should.any? + EnumerableSpecs::Numerous.new(false, 0, nil).should.any? end it "returns false if all elements are false or nil" do - EnumerableSpecs::Numerous.new(false).any?.should == false - EnumerableSpecs::Numerous.new(false, false).any?.should == false - EnumerableSpecs::Numerous.new(nil).any?.should == false - EnumerableSpecs::Numerous.new(nil, nil).any?.should == false - EnumerableSpecs::Numerous.new(nil, false, nil).any?.should == false + EnumerableSpecs::Numerous.new(false).should_not.any? + EnumerableSpecs::Numerous.new(false, false).should_not.any? + EnumerableSpecs::Numerous.new(nil).should_not.any? + EnumerableSpecs::Numerous.new(nil, nil).should_not.any? + EnumerableSpecs::Numerous.new(nil, false, nil).should_not.any? end it "gathers whole arrays as elements when each yields multiple" do diff --git a/spec/ruby/core/enumerable/none_spec.rb b/spec/ruby/core/enumerable/none_spec.rb index 8c886736ab..ec48eaf0a7 100644 --- a/spec/ruby/core/enumerable/none_spec.rb +++ b/spec/ruby/core/enumerable/none_spec.rb @@ -10,7 +10,7 @@ describe "Enumerable#none?" do end it "always returns true on empty enumeration" do - @empty.none?.should == true + @empty.should.none? @empty.none? { true }.should == true end diff --git a/spec/ruby/core/enumerable/one_spec.rb b/spec/ruby/core/enumerable/one_spec.rb index 46a10d68eb..6489c84742 100644 --- a/spec/ruby/core/enumerable/one_spec.rb +++ b/spec/ruby/core/enumerable/one_spec.rb @@ -10,7 +10,7 @@ describe "Enumerable#one?" do end it "always returns false on empty enumeration" do - @empty.one?.should == false + @empty.should_not.one? @empty.one? { true }.should == false end diff --git a/spec/ruby/core/enumerable/uniq_spec.rb b/spec/ruby/core/enumerable/uniq_spec.rb index 82c041d4ef..e58dd36366 100644 --- a/spec/ruby/core/enumerable/uniq_spec.rb +++ b/spec/ruby/core/enumerable/uniq_spec.rb @@ -79,8 +79,8 @@ describe 'Enumerable#uniq' do end a.uniq.should == a - a[0].tainted?.should == true - a[1].tainted?.should == true + a[0].should.tainted? + a[1].should.tainted? a = Array.new(2) do obj = mock('0') @@ -98,8 +98,8 @@ describe 'Enumerable#uniq' do end a.to_enum.uniq.size.should == 1 - a[0].tainted?.should == true - a[1].tainted?.should == true + a[0].should.tainted? + a[1].should.tainted? end end diff --git a/spec/ruby/core/enumerator/arithmetic_sequence/exclude_end_spec.rb b/spec/ruby/core/enumerator/arithmetic_sequence/exclude_end_spec.rb index 8ce0ce0cd9..5be189e993 100644 --- a/spec/ruby/core/enumerator/arithmetic_sequence/exclude_end_spec.rb +++ b/spec/ruby/core/enumerator/arithmetic_sequence/exclude_end_spec.rb @@ -4,15 +4,15 @@ ruby_version_is "2.6" do describe "Enumerator::ArithmeticSequence#exclude_end?" do context "when created using Numeric#step" do it "always returns false" do - 1.step(10).exclude_end?.should == false - 10.step(1).exclude_end?.should == false + 1.step(10).should_not.exclude_end? + 10.step(1).should_not.exclude_end? end end context "when created using Range#step" do it "mirrors range.exclude_end?" do - (1...10).step.exclude_end?.should == true - (1..10).step.exclude_end?.should == false + (1...10).step.should.exclude_end? + (1..10).step.should_not.exclude_end? end end end diff --git a/spec/ruby/core/env/element_reference_spec.rb b/spec/ruby/core/env/element_reference_spec.rb index 7d2a2d78e3..1cd58ace54 100644 --- a/spec/ruby/core/env/element_reference_spec.rb +++ b/spec/ruby/core/env/element_reference_spec.rb @@ -16,7 +16,7 @@ describe "ENV.[]" do it "returns only frozen values" do ENV[@variable] = "a non-frozen string" - ENV[@variable].frozen?.should == true + ENV[@variable].should.frozen? end it "coerces a non-string name with #to_str" do diff --git a/spec/ruby/core/env/empty_spec.rb b/spec/ruby/core/env/empty_spec.rb index 7ef17d244f..afeb406a9e 100644 --- a/spec/ruby/core/env/empty_spec.rb +++ b/spec/ruby/core/env/empty_spec.rb @@ -4,12 +4,12 @@ describe "ENV.empty?" do it "returns true if the Environment is empty" do if ENV.keys.size > 0 - ENV.empty?.should == false + ENV.should_not.empty? end orig = ENV.to_hash begin ENV.clear - ENV.empty?.should == true + ENV.should.empty? ensure ENV.replace orig end @@ -17,7 +17,7 @@ describe "ENV.empty?" do it "returns false if not empty" do if ENV.keys.size > 0 - ENV.empty?.should == false + ENV.should_not.empty? end end end diff --git a/spec/ruby/core/env/shift_spec.rb b/spec/ruby/core/env/shift_spec.rb index c03b5d50c5..0fe08d4f6d 100644 --- a/spec/ruby/core/env/shift_spec.rb +++ b/spec/ruby/core/env/shift_spec.rb @@ -2,7 +2,7 @@ require_relative '../../spec_helper' describe "ENV.shift" do it "returns a pair and deletes it" do - ENV.empty?.should == false + ENV.should_not.empty? orig = ENV.to_hash begin pair = ENV.shift diff --git a/spec/ruby/core/exception/success_spec.rb b/spec/ruby/core/exception/success_spec.rb index 70af9c74eb..6f21743340 100644 --- a/spec/ruby/core/exception/success_spec.rb +++ b/spec/ruby/core/exception/success_spec.rb @@ -3,13 +3,13 @@ require_relative '../../spec_helper' describe "SystemExit#success?" do it "returns true if the process exited successfully" do -> { exit 0 }.should raise_error(SystemExit) { |e| - e.success?.should == true + e.should.success? } end it "returns false if the process exited unsuccessfully" do -> { exit(-1) }.should raise_error(SystemExit) { |e| - e.success?.should == false + e.should_not.success? } end end diff --git a/spec/ruby/core/false/to_s_spec.rb b/spec/ruby/core/false/to_s_spec.rb index c996d87000..4cae278891 100644 --- a/spec/ruby/core/false/to_s_spec.rb +++ b/spec/ruby/core/false/to_s_spec.rb @@ -7,7 +7,7 @@ describe "FalseClass#to_s" do ruby_version_is "2.7" do it "returns a frozen string" do - false.to_s.frozen?.should == true + false.to_s.should.frozen? end it "always returns the same string" do diff --git a/spec/ruby/core/file/expand_path_spec.rb b/spec/ruby/core/file/expand_path_spec.rb index 88078645ab..c31f885b92 100644 --- a/spec/ruby/core/file/expand_path_spec.rb +++ b/spec/ruby/core/file/expand_path_spec.rb @@ -203,9 +203,9 @@ platform_is_not :windows do it "does not return a frozen string" do home = "/rubyspec_home" - File.expand_path('~').frozen?.should == false - File.expand_path('~', '/tmp/gumby/ddd').frozen?.should == false - File.expand_path('~/a', '/tmp/gumby/ddd').frozen?.should == false + File.expand_path('~').should_not.frozen? + File.expand_path('~', '/tmp/gumby/ddd').should_not.frozen? + File.expand_path('~/a', '/tmp/gumby/ddd').should_not.frozen? end end diff --git a/spec/ruby/core/file/lchmod_spec.rb b/spec/ruby/core/file/lchmod_spec.rb index bab362980a..4abe42526d 100644 --- a/spec/ruby/core/file/lchmod_spec.rb +++ b/spec/ruby/core/file/lchmod_spec.rb @@ -20,13 +20,13 @@ describe "File.lchmod" do File.chmod(0222, @lname).should == 1 File.lchmod(0755, @lname).should == 1 - File.lstat(@lname).executable?.should == true - File.lstat(@lname).readable?.should == true - File.lstat(@lname).writable?.should == true + File.lstat(@lname).should.executable? + File.lstat(@lname).should.readable? + File.lstat(@lname).should.writable? - File.stat(@lname).executable?.should == false - File.stat(@lname).readable?.should == false - File.stat(@lname).writable?.should == true + File.stat(@lname).should_not.executable? + File.stat(@lname).should_not.readable? + File.stat(@lname).should.writable? end end diff --git a/spec/ruby/core/file/lstat_spec.rb b/spec/ruby/core/file/lstat_spec.rb index 918ed02163..a5ea9d15a5 100644 --- a/spec/ruby/core/file/lstat_spec.rb +++ b/spec/ruby/core/file/lstat_spec.rb @@ -22,8 +22,8 @@ describe "File.lstat" do it "returns a File::Stat object with symlink properties for a symlink" do st = File.lstat(@link) - st.symlink?.should == true - st.file?.should == false + st.should.symlink? + st.should_not.file? end end end diff --git a/spec/ruby/core/file/open_spec.rb b/spec/ruby/core/file/open_spec.rb index 7ceeb47dd8..8faa31173e 100644 --- a/spec/ruby/core/file/open_spec.rb +++ b/spec/ruby/core/file/open_spec.rb @@ -28,7 +28,7 @@ describe "File.open" do describe "with a block" do it "does not raise error when file is closed inside the block" do @fh = File.open(@file) { |fh| fh.close; fh } - @fh.closed?.should == true + @fh.should.closed? end 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.open(@file, "w+") do |f| f.pos.should == 0 - f.eof?.should == true + f.should.eof? end File.size(@file).should == 0 end @@ -495,7 +495,7 @@ describe "File.open" do File.size(@file).should > 0 File.open(@file, "rb+") do |f| f.pos.should == 0 - f.eof?.should == false + f.should_not.eof? end end @@ -504,7 +504,7 @@ describe "File.open" do File.size(@file).should > 0 File.open(@file, "wb+") do |f| f.pos.should == 0 - f.eof?.should == true + f.should.eof? end File.size(@file).should == 0 end diff --git a/spec/ruby/core/file/stat/owned_spec.rb b/spec/ruby/core/file/stat/owned_spec.rb index fbd473c4d7..a23ad850c5 100644 --- a/spec/ruby/core/file/stat/owned_spec.rb +++ b/spec/ruby/core/file/stat/owned_spec.rb @@ -18,7 +18,7 @@ describe "File::Stat#owned?" do it "returns true if the file is owned by the user" do st = File.stat(@file) - st.owned?.should == true + st.should.owned? end 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 system_file = '/etc/passwd' st = File.stat(system_file) - st.owned?.should == false + st.should_not.owned? end end end diff --git a/spec/ruby/core/file/stat/pipe_spec.rb b/spec/ruby/core/file/stat/pipe_spec.rb index 7abb6c742a..692dfbf42a 100644 --- a/spec/ruby/core/file/stat/pipe_spec.rb +++ b/spec/ruby/core/file/stat/pipe_spec.rb @@ -12,7 +12,7 @@ describe "File::Stat#pipe?" do touch(filename) st = File.stat(filename) - st.pipe?.should == false + st.should_not.pipe? rm_r filename end @@ -23,7 +23,7 @@ describe "File::Stat#pipe?" do File.mkfifo(filename) st = File.stat(filename) - st.pipe?.should == true + st.should.pipe? rm_r filename end diff --git a/spec/ruby/core/file/stat_spec.rb b/spec/ruby/core/file/stat_spec.rb index 275eae36d5..6365500057 100644 --- a/spec/ruby/core/file/stat_spec.rb +++ b/spec/ruby/core/file/stat_spec.rb @@ -23,8 +23,8 @@ platform_is_not :windows do st = f.stat - st.file?.should == true - st.zero?.should == false + st.should.file? + st.should_not.zero? st.size.should == 8 st.size?.should == 8 st.blksize.should >= 0 @@ -38,8 +38,8 @@ platform_is_not :windows do File.symlink(@file, @link) st = File.stat(@link) - st.file?.should == true - st.symlink?.should == false + st.should.file? + st.should_not.symlink? end it "returns an error when given missing non-ASCII path" do diff --git a/spec/ruby/core/file/truncate_spec.rb b/spec/ruby/core/file/truncate_spec.rb index 43b86b7382..b4a2e3e577 100644 --- a/spec/ruby/core/file/truncate_spec.rb +++ b/spec/ruby/core/file/truncate_spec.rb @@ -18,7 +18,7 @@ describe "File.truncate" do File.open(@name, "r") do |f| f.read(99).should == "12345" - f.eof?.should == true + f.should.eof? end end @@ -120,7 +120,7 @@ describe "File#truncate" do File.size(@name).should == 5 File.open(@name, "r") do |f| f.read(99).should == "12345" - f.eof?.should == true + f.should.eof? end end @@ -161,7 +161,7 @@ describe "File#truncate" do it "raises an IOError if file is closed" do @file.close - @file.closed?.should == true + @file.should.closed? -> { @file.truncate(42) }.should raise_error(IOError) end diff --git a/spec/ruby/core/float/finite_spec.rb b/spec/ruby/core/float/finite_spec.rb index c5fb3df849..d839b30e32 100644 --- a/spec/ruby/core/float/finite_spec.rb +++ b/spec/ruby/core/float/finite_spec.rb @@ -2,18 +2,18 @@ require_relative '../../spec_helper' describe "Float#finite?" do it "returns true for finite values" do - 3.14159.finite?.should == true + 3.14159.should.finite? end it "returns false for positive infinity" do - infinity_value.finite?.should == false + infinity_value.should_not.finite? end it "returns false for negative infinity" do - (-infinity_value).finite?.should == false + (-infinity_value).should_not.finite? end it "returns false for NaN" do - nan_value.finite?.should == false + nan_value.should_not.finite? end end diff --git a/spec/ruby/core/float/nan_spec.rb b/spec/ruby/core/float/nan_spec.rb index d09d25153c..c1043ef21b 100644 --- a/spec/ruby/core/float/nan_spec.rb +++ b/spec/ruby/core/float/nan_spec.rb @@ -2,8 +2,8 @@ require_relative '../../spec_helper' describe "Float#nan?" do it "returns true if self is not a valid IEEE floating-point number" do - 0.0.nan?.should == false - -1.5.nan?.should == false - nan_value.nan?.should == true + 0.0.should_not.nan? + -1.5.should_not.nan? + nan_value.should.nan? end end diff --git a/spec/ruby/core/float/next_float_spec.rb b/spec/ruby/core/float/next_float_spec.rb index 2f0eff605a..29e2d31146 100644 --- a/spec/ruby/core/float/next_float_spec.rb +++ b/spec/ruby/core/float/next_float_spec.rb @@ -44,6 +44,6 @@ describe "Float#next_float" do end it "returns NAN if NAN was the receiver" do - Float::NAN.next_float.nan?.should == true + Float::NAN.next_float.should.nan? end end diff --git a/spec/ruby/core/float/prev_float_spec.rb b/spec/ruby/core/float/prev_float_spec.rb index 40fcc25a6d..5e50269da7 100644 --- a/spec/ruby/core/float/prev_float_spec.rb +++ b/spec/ruby/core/float/prev_float_spec.rb @@ -44,6 +44,6 @@ describe "Float#prev_float" do end it "returns NAN if NAN was the receiver" do - Float::NAN.prev_float.nan?.should == true + Float::NAN.prev_float.should.nan? end end diff --git a/spec/ruby/core/float/uminus_spec.rb b/spec/ruby/core/float/uminus_spec.rb index e676a26ada..57bae0fb4b 100644 --- a/spec/ruby/core/float/uminus_spec.rb +++ b/spec/ruby/core/float/uminus_spec.rb @@ -23,6 +23,6 @@ describe "Float#-@" do end it "returns NaN for NaN" do - nan_value.send(:-@).nan?.should == true + nan_value.send(:-@).should.nan? end end diff --git a/spec/ruby/core/float/zero_spec.rb b/spec/ruby/core/float/zero_spec.rb index e70edc422a..1f3de27793 100644 --- a/spec/ruby/core/float/zero_spec.rb +++ b/spec/ruby/core/float/zero_spec.rb @@ -2,8 +2,8 @@ require_relative '../../spec_helper' describe "Float#zero?" do it "returns true if self is 0.0" do - 0.0.zero?.should == true - 1.0.zero?.should == false - -1.0.zero?.should == false + 0.0.should.zero? + 1.0.should_not.zero? + -1.0.should_not.zero? end end diff --git a/spec/ruby/core/gc/profiler/disable_spec.rb b/spec/ruby/core/gc/profiler/disable_spec.rb index 321a207deb..74089693eb 100644 --- a/spec/ruby/core/gc/profiler/disable_spec.rb +++ b/spec/ruby/core/gc/profiler/disable_spec.rb @@ -11,6 +11,6 @@ describe "GC::Profiler.disable" do it "disables the profiler" do GC::Profiler.disable - GC::Profiler.enabled?.should == false + GC::Profiler.should_not.enabled? end end diff --git a/spec/ruby/core/gc/profiler/enable_spec.rb b/spec/ruby/core/gc/profiler/enable_spec.rb index 1594511675..313ca3d949 100644 --- a/spec/ruby/core/gc/profiler/enable_spec.rb +++ b/spec/ruby/core/gc/profiler/enable_spec.rb @@ -12,6 +12,6 @@ describe "GC::Profiler.enable" do it "enables the profiler" do GC::Profiler.enable - GC::Profiler.enabled?.should == true + GC::Profiler.should.enabled? end end diff --git a/spec/ruby/core/hash/any_spec.rb b/spec/ruby/core/hash/any_spec.rb index bd33e8cd8f..c26dfabde6 100644 --- a/spec/ruby/core/hash/any_spec.rb +++ b/spec/ruby/core/hash/any_spec.rb @@ -4,10 +4,10 @@ describe "Hash#any?" do describe 'with no block given' do it "checks if there are any members of a Hash" do empty_hash = {} - empty_hash.any?.should == false + empty_hash.should_not.any? hash_with_members = { 'key' => 'value' } - hash_with_members.any?.should == true + hash_with_members.should.any? end end diff --git a/spec/ruby/core/hash/compare_by_identity_spec.rb b/spec/ruby/core/hash/compare_by_identity_spec.rb index 0fd41a4d58..874cd46eb7 100644 --- a/spec/ruby/core/hash/compare_by_identity_spec.rb +++ b/spec/ruby/core/hash/compare_by_identity_spec.rb @@ -33,7 +33,7 @@ describe "Hash#compare_by_identity" do it "has no effect on an already compare_by_identity hash" do @idh[:foo] = :bar @idh.compare_by_identity.should equal @idh - @idh.compare_by_identity?.should == true + @idh.should.compare_by_identity? @idh[:foo].should == :bar end diff --git a/spec/ruby/core/hash/empty_spec.rb b/spec/ruby/core/hash/empty_spec.rb index e9be44bab0..881e1cc34b 100644 --- a/spec/ruby/core/hash/empty_spec.rb +++ b/spec/ruby/core/hash/empty_spec.rb @@ -3,13 +3,13 @@ require_relative 'fixtures/classes' describe "Hash#empty?" do it "returns true if the hash has no entries" do - {}.empty?.should == true - { 1 => 1 }.empty?.should == false + {}.should.empty? + { 1 => 1 }.should_not.empty? end it "returns true if the hash has no entries and has a default value" do - Hash.new(5).empty?.should == true - Hash.new { 5 }.empty?.should == true - Hash.new { |hsh, k| hsh[k] = k }.empty?.should == true + Hash.new(5).should.empty? + Hash.new { 5 }.should.empty? + Hash.new { |hsh, k| hsh[k] = k }.should.empty? end end diff --git a/spec/ruby/core/hash/reject_spec.rb b/spec/ruby/core/hash/reject_spec.rb index 38589fd880..397000ab67 100644 --- a/spec/ruby/core/hash/reject_spec.rb +++ b/spec/ruby/core/hash/reject_spec.rb @@ -35,7 +35,7 @@ describe "Hash#reject" do ruby_version_is ''...'2.7' do it "does not taint the resulting hash" do h = { a: 1 }.taint - h.reject {false}.tainted?.should == false + h.reject {false}.should_not.tainted? end end end diff --git a/spec/ruby/core/hash/shared/store.rb b/spec/ruby/core/hash/shared/store.rb index 6e2557eb28..84ffb41e33 100644 --- a/spec/ruby/core/hash/shared/store.rb +++ b/spec/ruby/core/hash/shared/store.rb @@ -50,7 +50,7 @@ describe :hash_store, shared: true do key << "bar" h.should == { "foo" => 0 } - h.keys[0].frozen?.should == true + h.keys[0].should.frozen? end it "doesn't duplicate and freeze already frozen string keys" do diff --git a/spec/ruby/core/hash/to_proc_spec.rb b/spec/ruby/core/hash/to_proc_spec.rb index 700621f162..8b7ddd5e00 100644 --- a/spec/ruby/core/hash/to_proc_spec.rb +++ b/spec/ruby/core/hash/to_proc_spec.rb @@ -21,13 +21,13 @@ describe "Hash#to_proc" do ruby_version_is ""..."2.8" do it "is not a lambda" do - @proc.lambda?.should == false + @proc.should_not.lambda? end end ruby_version_is "2.8" do it "is a lambda" do - @proc.lambda?.should == true + @proc.should.lambda? end end diff --git a/spec/ruby/core/integer/integer_spec.rb b/spec/ruby/core/integer/integer_spec.rb index f8067cda06..2d5d2e3e92 100644 --- a/spec/ruby/core/integer/integer_spec.rb +++ b/spec/ruby/core/integer/integer_spec.rb @@ -13,8 +13,8 @@ end describe "Integer#integer?" do it "returns true for Integers" do - 0.integer?.should == true - -1.integer?.should == true - bignum_value.integer?.should == true + 0.should.integer? + -1.should.integer? + bignum_value.should.integer? end end diff --git a/spec/ruby/core/io/close_on_exec_spec.rb b/spec/ruby/core/io/close_on_exec_spec.rb index f837bb56af..91bd3c8c40 100644 --- a/spec/ruby/core/io/close_on_exec_spec.rb +++ b/spec/ruby/core/io/close_on_exec_spec.rb @@ -14,24 +14,24 @@ describe "IO#close_on_exec=" do guard -> { platform_is_not :windows } do it "sets the close-on-exec flag if true" do @io.close_on_exec = true - @io.close_on_exec?.should == true + @io.should.close_on_exec? end it "sets the close-on-exec flag if non-false" do @io.close_on_exec = :true - @io.close_on_exec?.should == true + @io.should.close_on_exec? end it "unsets the close-on-exec flag if false" do @io.close_on_exec = true @io.close_on_exec = false - @io.close_on_exec?.should == false + @io.should_not.close_on_exec? end it "unsets the close-on-exec flag if nil" do @io.close_on_exec = true @io.close_on_exec = nil - @io.close_on_exec?.should == false + @io.should_not.close_on_exec? end 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 it "returns true by default" do - @io.close_on_exec?.should == true + @io.should.close_on_exec? end it "returns true if set" do @io.close_on_exec = true - @io.close_on_exec?.should == true + @io.should.close_on_exec? end it "raises IOError if called on a closed IO" do diff --git a/spec/ruby/core/io/close_read_spec.rb b/spec/ruby/core/io/close_read_spec.rb index 6fa4fc8ff8..26454bfddd 100644 --- a/spec/ruby/core/io/close_read_spec.rb +++ b/spec/ruby/core/io/close_read_spec.rb @@ -49,7 +49,7 @@ describe "IO#close_read" do io.close_read - io.closed?.should == true + io.should.closed? end it "does nothing on closed stream" do diff --git a/spec/ruby/core/io/close_spec.rb b/spec/ruby/core/io/close_spec.rb index 37c8ab5a12..dda82b34de 100644 --- a/spec/ruby/core/io/close_spec.rb +++ b/spec/ruby/core/io/close_spec.rb @@ -14,7 +14,7 @@ describe "IO#close" do it "closes the stream" do @io.close - @io.closed?.should == true + @io.should.closed? end it "returns nil" do diff --git a/spec/ruby/core/io/close_write_spec.rb b/spec/ruby/core/io/close_write_spec.rb index 75e1577654..14835e4e2c 100644 --- a/spec/ruby/core/io/close_write_spec.rb +++ b/spec/ruby/core/io/close_write_spec.rb @@ -45,7 +45,7 @@ describe "IO#close_write" do io.close_write - io.closed?.should == true + io.should.closed? end it "flushes and closes the write stream" do diff --git a/spec/ruby/core/io/dup_spec.rb b/spec/ruby/core/io/dup_spec.rb index de32c5e347..8cadaee118 100644 --- a/spec/ruby/core/io/dup_spec.rb +++ b/spec/ruby/core/io/dup_spec.rb @@ -51,16 +51,16 @@ end @i.close -> { @f.gets }.should_not raise_error(Exception) - @i.closed?.should == true - @f.closed?.should == false + @i.should.closed? + @f.should_not.closed? end it "allows closing the original IO without affecting the new one" do @f.close -> { @i.gets }.should_not raise_error(Exception) - @i.closed?.should == false - @f.closed?.should == true + @i.should_not.closed? + @f.should.closed? end it "raises IOError on closed stream" do @@ -71,7 +71,7 @@ end @f.close_on_exec = true dup = @f.dup begin - dup.close_on_exec?.should == true + dup.should.close_on_exec? ensure dup.close end @@ -79,7 +79,7 @@ end @f.close_on_exec = false dup = @f.dup begin - dup.close_on_exec?.should == true + dup.should.close_on_exec? ensure dup.close end diff --git a/spec/ruby/core/io/eof_spec.rb b/spec/ruby/core/io/eof_spec.rb index 8fd3c37132..315345d942 100644 --- a/spec/ruby/core/io/eof_spec.rb +++ b/spec/ruby/core/io/eof_spec.rb @@ -12,7 +12,7 @@ describe "IO#eof?" do end 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 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 @io.read 1 - @io.eof?.should == false + @io.should_not.eof? end it "returns true after reading with read with no parameters" do @io.read() - @io.eof?.should == true + @io.should.eof? end it "returns true after reading with read" do @io.read(File.size(@name)) - @io.eof?.should == true + @io.should.eof? end it "returns true after reading with sysread" do @io.sysread(File.size(@name)) - @io.eof?.should == true + @io.should.eof? end it "returns true after reading with readlines" do @io.readlines - @io.eof?.should == true + @io.should.eof? end it "returns false on just opened non-empty stream" do - @io.eof?.should == false + @io.should_not.eof? end it "does not consume the data from the stream" do - @io.eof?.should == false + @io.should_not.eof? @io.getc.should == 'V' end @@ -78,7 +78,7 @@ describe "IO#eof?" do it "returns true on one-byte stream after single-byte read" do File.open(File.dirname(__FILE__) + '/fixtures/one_byte.txt') { |one_byte| one_byte.read(1) - one_byte.eof?.should == true + one_byte.should.eof? } end end @@ -92,16 +92,16 @@ describe "IO#eof?" do it "returns true on receiving side of Pipe when writing side is closed" do @r, @w = IO.pipe @w.close - @r.eof?.should == true + @r.should.eof? end it "returns false on receiving side of Pipe when writing side wrote some data" do @r, @w = IO.pipe @w.puts "hello" - @r.eof?.should == false + @r.should_not.eof? @w.close - @r.eof?.should == false + @r.should_not.eof? @r.read - @r.eof?.should == true + @r.should.eof? end end diff --git a/spec/ruby/core/io/gets_spec.rb b/spec/ruby/core/io/gets_spec.rb index 39b2108476..a3cd180b66 100644 --- a/spec/ruby/core/io/gets_spec.rb +++ b/spec/ruby/core/io/gets_spec.rb @@ -41,7 +41,7 @@ describe "IO#gets" do ruby_version_is ''...'2.7' do it "returns tainted strings" do while line = @io.gets - line.tainted?.should == true + line.should.tainted? end end end @@ -67,7 +67,7 @@ describe "IO#gets" do ruby_version_is ''...'2.7' do it "returns tainted strings" do while line = @io.gets(nil) - line.tainted?.should == true + line.should.tainted? end end end @@ -103,7 +103,7 @@ describe "IO#gets" do ruby_version_is ''...'2.7' do it "returns tainted strings" do while line = @io.gets("") - line.tainted?.should == true + line.should.tainted? end end end @@ -129,7 +129,7 @@ describe "IO#gets" do ruby_version_is ''...'2.7' do it "returns tainted strings" do while line = @io.gets("la") - line.tainted?.should == true + line.should.tainted? end end end diff --git a/spec/ruby/core/io/pipe_spec.rb b/spec/ruby/core/io/pipe_spec.rb index a7dcb7fab8..2f2cf06f4d 100644 --- a/spec/ruby/core/io/pipe_spec.rb +++ b/spec/ruby/core/io/pipe_spec.rb @@ -44,8 +44,8 @@ describe "IO.pipe" do r, w = IO.pipe do |_r, _w| [_r, _w] end - r.closed?.should == true - w.closed?.should == true + r.should.closed? + w.should.closed? end it "closes both IO objects when the block raises" do @@ -57,8 +57,8 @@ describe "IO.pipe" do raise RuntimeError end end.should raise_error(RuntimeError) - r.closed?.should == true - w.closed?.should == true + r.should.closed? + w.should.closed? end it "allows IO objects to be closed within the block" do @@ -67,8 +67,8 @@ describe "IO.pipe" do _w.close [_r, _w] end - r.closed?.should == true - w.closed?.should == true + r.should.closed? + w.should.closed? end end end diff --git a/spec/ruby/core/io/popen_spec.rb b/spec/ruby/core/io/popen_spec.rb index 4f873e61cd..e9d32c5c7d 100644 --- a/spec/ruby/core/io/popen_spec.rb +++ b/spec/ruby/core/io/popen_spec.rb @@ -77,10 +77,10 @@ describe "IO.popen" do Process.kill "KILL", pid @io.close platform_is_not :windows do - $?.signaled?.should == true + $?.should.signaled? end platform_is :windows do - $?.exited?.should == true + $?.should.exited? end end diff --git a/spec/ruby/core/io/read_nonblock_spec.rb b/spec/ruby/core/io/read_nonblock_spec.rb index 63ccab5a44..e50531d336 100644 --- a/spec/ruby/core/io/read_nonblock_spec.rb +++ b/spec/ruby/core/io/read_nonblock_spec.rb @@ -46,7 +46,7 @@ describe "IO#read_nonblock" do require 'io/nonblock' @write.write "abc" @read.read_nonblock(1).should == "a" - @read.nonblock?.should == true + @read.should.nonblock? end end diff --git a/spec/ruby/core/io/read_spec.rb b/spec/ruby/core/io/read_spec.rb index 1e9a8d2a4f..841e693f37 100644 --- a/spec/ruby/core/io/read_spec.rb +++ b/spec/ruby/core/io/read_spec.rb @@ -216,7 +216,7 @@ describe "IO#read" do it "is at end-of-file when everything has been read" do @io.read - @io.eof?.should == true + @io.should.eof? end it "reads the contents of a file" do diff --git a/spec/ruby/core/io/reopen_spec.rb b/spec/ruby/core/io/reopen_spec.rb index faef80f513..8ff0f217f4 100644 --- a/spec/ruby/core/io/reopen_spec.rb +++ b/spec/ruby/core/io/reopen_spec.rb @@ -150,11 +150,11 @@ describe "IO#reopen with a String" do @io.close_on_exec = true @io.reopen @other_name - @io.close_on_exec?.should == true + @io.should.close_on_exec? @io.close_on_exec = false @io.reopen @other_name - @io.close_on_exec?.should == true + @io.should.close_on_exec? end 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 @io.close_on_exec = true @io.reopen @other_io - @io.close_on_exec?.should == true + @io.should.close_on_exec? @other_io.close_on_exec = false @io.close_on_exec = false @io.reopen @other_io - @io.close_on_exec?.should == true + @io.should.close_on_exec? end it "may change the class of the instance" do diff --git a/spec/ruby/core/io/rewind_spec.rb b/spec/ruby/core/io/rewind_spec.rb index 954d56d30c..649041afaf 100644 --- a/spec/ruby/core/io/rewind_spec.rb +++ b/spec/ruby/core/io/rewind_spec.rb @@ -21,7 +21,7 @@ describe "IO#rewind" do it "positions the instance to the beginning of input and clears EOF" do value = @io.read @io.rewind - @io.eof?.should == false + @io.should_not.eof? value.should == @io.read end diff --git a/spec/ruby/core/io/seek_spec.rb b/spec/ruby/core/io/seek_spec.rb index 7e9c308272..2fa4a73ac9 100644 --- a/spec/ruby/core/io/seek_spec.rb +++ b/spec/ruby/core/io/seek_spec.rb @@ -44,21 +44,21 @@ describe "IO#seek" do it "moves the read position and clears EOF with SEEK_SET" do value = @io.read @io.seek(0, IO::SEEK_SET) - @io.eof?.should == false + @io.should_not.eof? value.should == @io.read end it "moves the read position and clears EOF with SEEK_CUR" do value = @io.read @io.seek(-1, IO::SEEK_CUR) - @io.eof?.should == false + @io.should_not.eof? value[-1].should == @io.read[0] end it "moves the read position and clears EOF with SEEK_END" do value = @io.read @io.seek(-1, IO::SEEK_END) - @io.eof?.should == false + @io.should_not.eof? value[-1].should == @io.read[0] end diff --git a/spec/ruby/core/io/shared/new.rb b/spec/ruby/core/io/shared/new.rb index 27d32f97ed..87f3001862 100644 --- a/spec/ruby/core/io/shared/new.rb +++ b/spec/ruby/core/io/shared/new.rb @@ -148,22 +148,22 @@ describe :io_new, shared: true do it "sets binmode from mode string" do @io = IO.send(@method, @fd, 'wb') - @io.binmode?.should == true + @io.should.binmode? end it "does not set binmode without being asked" do @io = IO.send(@method, @fd, 'w') - @io.binmode?.should == false + @io.should_not.binmode? end it "sets binmode from :binmode option" do @io = IO.send(@method, @fd, 'w', binmode: true) - @io.binmode?.should == true + @io.should.binmode? end it "does not set binmode from false :binmode" do @io = IO.send(@method, @fd, 'w', binmode: false) - @io.binmode?.should == false + @io.should_not.binmode? end 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 @io = IO.send(@method, @fd, 'w', autoclose: false) - @io.autoclose?.should == false + @io.should_not.autoclose? @io.autoclose = true end it "accepts any truthy option :autoclose" do @io = IO.send(@method, @fd, 'w', autoclose: 42) - @io.autoclose?.should == true + @io.should.autoclose? end end diff --git a/spec/ruby/core/io/shared/pos.rb b/spec/ruby/core/io/shared/pos.rb index fb6d8087bc..0b4d1e13b3 100644 --- a/spec/ruby/core/io/shared/pos.rb +++ b/spec/ruby/core/io/shared/pos.rb @@ -27,7 +27,7 @@ describe :io_pos, shared: true do io.read 1 io.read 1 io.send(@method) - io.eof?.should == false + io.should_not.eof? end end end diff --git a/spec/ruby/core/io/ungetc_spec.rb b/spec/ruby/core/io/ungetc_spec.rb index 4be0e3aa8b..85c15b5a71 100644 --- a/spec/ruby/core/io/ungetc_spec.rb +++ b/spec/ruby/core/io/ungetc_spec.rb @@ -74,10 +74,10 @@ describe "IO#ungetc" do touch(@empty) File.open(@empty) { |empty| - empty.eof?.should == true + empty.should.eof? empty.getc.should == nil empty.ungetc(100) - empty.eof?.should == false + empty.should_not.eof? } end diff --git a/spec/ruby/core/io/write_nonblock_spec.rb b/spec/ruby/core/io/write_nonblock_spec.rb index 5474e5c6ce..a8b9ce0a36 100644 --- a/spec/ruby/core/io/write_nonblock_spec.rb +++ b/spec/ruby/core/io/write_nonblock_spec.rb @@ -79,7 +79,7 @@ describe 'IO#write_nonblock' do it 'sets the IO in nonblock mode' do require 'io/nonblock' @write.write_nonblock('a') - @write.nonblock?.should == true + @write.should.nonblock? end end end diff --git a/spec/ruby/core/kernel/backtick_spec.rb b/spec/ruby/core/kernel/backtick_spec.rb index 5ab0fb0eea..391583b539 100644 --- a/spec/ruby/core/kernel/backtick_spec.rb +++ b/spec/ruby/core/kernel/backtick_spec.rb @@ -40,16 +40,16 @@ describe "Kernel#`" do ip = 'world' `echo disc #{ip}` $?.should be_kind_of(Process::Status) - $?.stopped?.should == false - $?.exited?.should == true + $?.should_not.stopped? + $?.should.exited? $?.exitstatus.should == 0 - $?.success?.should == true + $?.should.success? `echo disc #{ip}; exit 99` $?.should be_kind_of(Process::Status) - $?.stopped?.should == false - $?.exited?.should == true + $?.should_not.stopped? + $?.should.exited? $?.exitstatus.should == 99 - $?.success?.should == false + $?.should_not.success? end end @@ -58,16 +58,16 @@ describe "Kernel#`" do ip = 'world' `echo disc #{ip}` $?.should be_kind_of(Process::Status) - $?.stopped?.should == false - $?.exited?.should == true + $?.should_not.stopped? + $?.should.exited? $?.exitstatus.should == 0 - $?.success?.should == true + $?.should.success? `echo disc #{ip}& exit 99` $?.should be_kind_of(Process::Status) - $?.stopped?.should == false - $?.exited?.should == true + $?.should_not.stopped? + $?.should.exited? $?.exitstatus.should == 99 - $?.success?.should == false + $?.should_not.success? end end end diff --git a/spec/ruby/core/kernel/caller_locations_spec.rb b/spec/ruby/core/kernel/caller_locations_spec.rb index cb344e16a0..c4e0084085 100644 --- a/spec/ruby/core/kernel/caller_locations_spec.rb +++ b/spec/ruby/core/kernel/caller_locations_spec.rb @@ -7,7 +7,7 @@ describe 'Kernel#caller_locations' do end it 'returns an Array of caller locations' do - KernelSpecs::CallerLocationsTest.locations.empty?.should == false + KernelSpecs::CallerLocationsTest.locations.should_not.empty? end it 'returns an Array of caller locations using a custom offset' do diff --git a/spec/ruby/core/kernel/caller_spec.rb b/spec/ruby/core/kernel/caller_spec.rb index e943e36dc2..b71060770c 100644 --- a/spec/ruby/core/kernel/caller_spec.rb +++ b/spec/ruby/core/kernel/caller_spec.rb @@ -7,7 +7,7 @@ describe 'Kernel#caller' do end it 'returns an Array of caller locations' do - KernelSpecs::CallerTest.locations.empty?.should == false + KernelSpecs::CallerTest.locations.should_not.empty? end it 'returns an Array of caller locations using a custom offset' do diff --git a/spec/ruby/core/kernel/clone_spec.rb b/spec/ruby/core/kernel/clone_spec.rb index 1bbef64f85..6aeb57f55b 100644 --- a/spec/ruby/core/kernel/clone_spec.rb +++ b/spec/ruby/core/kernel/clone_spec.rb @@ -33,22 +33,22 @@ describe "Kernel#clone" do @obj.freeze o3 = @obj.clone - o2.frozen?.should == false - o3.frozen?.should == true + o2.should_not.frozen? + o3.should.frozen? end ruby_version_is '2.8' 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.clone(freeze: true).frozen?.should == true + @obj.clone(freeze: true).should.frozen? end end 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.clone(freeze: false).frozen?.should == false + @obj.clone(freeze: false).should_not.frozen? end it "copies instance variables" do diff --git a/spec/ruby/core/kernel/dup_spec.rb b/spec/ruby/core/kernel/dup_spec.rb index fe0a269d69..70198abdb7 100644 --- a/spec/ruby/core/kernel/dup_spec.rb +++ b/spec/ruby/core/kernel/dup_spec.rb @@ -32,7 +32,7 @@ describe "Kernel#dup" do @obj.freeze dup = @obj.dup - dup.frozen?.should == false + dup.should_not.frozen? end it "copies instance variables" do diff --git a/spec/ruby/core/kernel/frozen_spec.rb b/spec/ruby/core/kernel/frozen_spec.rb index 54edae15b1..a4cec4263d 100644 --- a/spec/ruby/core/kernel/frozen_spec.rb +++ b/spec/ruby/core/kernel/frozen_spec.rb @@ -6,8 +6,8 @@ describe "Kernel#frozen?" do o = mock('o') p = mock('p') p.freeze - o.frozen?.should == false - p.frozen?.should == true + o.should_not.frozen? + p.should.frozen? end describe "on true, false and nil" do diff --git a/spec/ruby/core/kernel/shared/dup_clone.rb b/spec/ruby/core/kernel/shared/dup_clone.rb index 968efd80f3..84ad49cbde 100644 --- a/spec/ruby/core/kernel/shared/dup_clone.rb +++ b/spec/ruby/core/kernel/shared/dup_clone.rb @@ -59,8 +59,8 @@ describe :kernel_dup_clone, shared: true do o.taint o3 = o.send(@method) - o2.tainted?.should == false - o3.tainted?.should == true + o2.should_not.tainted? + o3.should.tainted? end end @@ -78,8 +78,8 @@ describe :kernel_dup_clone, shared: true do o.untrust o3 = o.send(@method) - o2.untrusted?.should == false - o3.untrusted?.should == true + o2.should_not.untrusted? + o3.should.untrusted? end end diff --git a/spec/ruby/core/kernel/system_spec.rb b/spec/ruby/core/kernel/system_spec.rb index 9196a9f9f1..696e6ae3d7 100644 --- a/spec/ruby/core/kernel/system_spec.rb +++ b/spec/ruby/core/kernel/system_spec.rb @@ -6,14 +6,14 @@ describe :kernel_system, shared: true do -> { @object.system("echo a") }.should output_to_fd("a\n") $?.should be_an_instance_of Process::Status - $?.success?.should == true + $?.should.success? end it "returns true when the command exits with a zero exit status" do @object.system(ruby_cmd('exit 0')).should == true $?.should be_an_instance_of Process::Status - $?.success?.should == true + $?.should.success? $?.exitstatus.should == 0 end @@ -21,7 +21,7 @@ describe :kernel_system, shared: true do @object.system(ruby_cmd('exit 1')).should == false $?.should be_an_instance_of Process::Status - $?.success?.should == false + $?.should_not.success? $?.exitstatus.should == 1 end diff --git a/spec/ruby/core/kernel/taint_spec.rb b/spec/ruby/core/kernel/taint_spec.rb index 2d2b34d0d0..060e73963e 100644 --- a/spec/ruby/core/kernel/taint_spec.rb +++ b/spec/ruby/core/kernel/taint_spec.rb @@ -11,7 +11,7 @@ describe "Kernel#taint" do it "sets the tainted bit" do o = Object.new o.taint - o.tainted?.should == true + o.should.tainted? end 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 [nil, true, false].each do |v| v.taint - v.tainted?.should == false + v.should_not.tainted? end end it "no raises a RuntimeError on symbols" do v = :sym -> { v.taint }.should_not raise_error(RuntimeError) - v.tainted?.should == false + v.should_not.tainted? end it "no raises error on fixnum values" do [1].each do |v| -> { v.taint }.should_not raise_error(RuntimeError) - v.tainted?.should == false + v.should_not.tainted? end end end diff --git a/spec/ruby/core/kernel/tainted_spec.rb b/spec/ruby/core/kernel/tainted_spec.rb index 72ce346dda..dbd6bc939a 100644 --- a/spec/ruby/core/kernel/tainted_spec.rb +++ b/spec/ruby/core/kernel/tainted_spec.rb @@ -7,8 +7,8 @@ describe "Kernel#tainted?" do o = mock('o') p = mock('p') p.taint - o.tainted?.should == false - p.tainted?.should == true + o.should_not.tainted? + p.should.tainted? end end end diff --git a/spec/ruby/core/kernel/trust_spec.rb b/spec/ruby/core/kernel/trust_spec.rb index dbc05b45d4..1d209ea1dc 100644 --- a/spec/ruby/core/kernel/trust_spec.rb +++ b/spec/ruby/core/kernel/trust_spec.rb @@ -11,7 +11,7 @@ describe "Kernel#trust" do it "clears the untrusted bit" do o = Object.new.untrust o.trust - o.untrusted?.should == false + o.should_not.untrusted? end it "raises FrozenError on an untrusted, frozen object" do diff --git a/spec/ruby/core/kernel/untaint_spec.rb b/spec/ruby/core/kernel/untaint_spec.rb index df9e3144a0..171d32b356 100644 --- a/spec/ruby/core/kernel/untaint_spec.rb +++ b/spec/ruby/core/kernel/untaint_spec.rb @@ -11,7 +11,7 @@ describe "Kernel#untaint" do it "clears the tainted bit" do o = Object.new.taint o.untaint - o.tainted?.should == false + o.should_not.tainted? end it "raises FrozenError on a tainted, frozen object" do diff --git a/spec/ruby/core/kernel/untrust_spec.rb b/spec/ruby/core/kernel/untrust_spec.rb index c5a36e1a1d..fca7c9ea47 100644 --- a/spec/ruby/core/kernel/untrust_spec.rb +++ b/spec/ruby/core/kernel/untrust_spec.rb @@ -11,7 +11,7 @@ describe "Kernel#untrust" do it "sets the untrusted bit" do o = Object.new o.untrust - o.untrusted?.should == true + o.should.untrusted? end it "raises FrozenError on a trusted, frozen object" do diff --git a/spec/ruby/core/kernel/untrusted_spec.rb b/spec/ruby/core/kernel/untrusted_spec.rb index ccebfe38be..65cbffa3ad 100644 --- a/spec/ruby/core/kernel/untrusted_spec.rb +++ b/spec/ruby/core/kernel/untrusted_spec.rb @@ -5,9 +5,9 @@ describe "Kernel#untrusted?" do ruby_version_is ''...'2.7' do it "returns the untrusted status of an object" do o = mock('o') - o.untrusted?.should == false + o.should_not.untrusted? o.untrust - o.untrusted?.should == true + o.should.untrusted? end it "has no effect on immediate values" do @@ -17,9 +17,9 @@ describe "Kernel#untrusted?" do a.untrust b.untrust c.untrust - a.untrusted?.should == false - b.untrusted?.should == false - c.untrusted?.should == false + a.should_not.untrusted? + b.should_not.untrusted? + c.should_not.untrusted? end it "has effect on immediate values" do diff --git a/spec/ruby/core/matchdata/string_spec.rb b/spec/ruby/core/matchdata/string_spec.rb index db0d5dfbdc..420233e1f3 100644 --- a/spec/ruby/core/matchdata/string_spec.rb +++ b/spec/ruby/core/matchdata/string_spec.rb @@ -9,7 +9,7 @@ describe "MatchData#string" do it "returns a frozen copy of the match string" do str = /(.)(.)(\d+)(\d)/.match("THX1138.").string str.should == "THX1138." - str.frozen?.should == true + str.should.frozen? end 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 'he[[o'.gsub!('[', ']') $~.string.should == 'he[[o' - $~.string.frozen?.should == true + $~.string.should.frozen? end end diff --git a/spec/ruby/core/math/tan_spec.rb b/spec/ruby/core/math/tan_spec.rb index c7b188cd81..67307f1e6e 100644 --- a/spec/ruby/core/math/tan_spec.rb +++ b/spec/ruby/core/math/tan_spec.rb @@ -14,8 +14,8 @@ describe "Math.tan" do end it "returns NaN if called with +-Infinity" do - Math.tan(infinity_value).nan?.should == true - Math.tan(-infinity_value).nan?.should == true + Math.tan(infinity_value).should.nan? + Math.tan(-infinity_value).should.nan? end it "raises a TypeError if the argument cannot be coerced with Float()" do diff --git a/spec/ruby/core/method/compose_spec.rb b/spec/ruby/core/method/compose_spec.rb index 2cf5b21670..0e2a0eeea2 100644 --- a/spec/ruby/core/method/compose_spec.rb +++ b/spec/ruby/core/method/compose_spec.rb @@ -39,8 +39,8 @@ ruby_version_is "2.6" do double = proc { |x| x + x } (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).lambda?.should == false } + ruby_version_is(''...'2.8') { (pow_2 << double).should.lambda? } + ruby_version_is('2.8') { (pow_2 << double).should_not.lambda? } end it "may accept multiple arguments" do @@ -88,7 +88,7 @@ ruby_version_is "2.6" do double = proc { |x| x + x } (pow_2 >> double).is_a?(Proc).should == true - (pow_2 >> double).lambda?.should == true + (pow_2 >> double).should.lambda? end it "may accept multiple arguments" do diff --git a/spec/ruby/core/module/included_spec.rb b/spec/ruby/core/module/included_spec.rb index f8dbad1d31..2fdd4325f2 100644 --- a/spec/ruby/core/module/included_spec.rb +++ b/spec/ruby/core/module/included_spec.rb @@ -39,6 +39,6 @@ describe "Module#included" do it "works with super using a singleton class" do ModuleSpecs::SingletonOnModuleCase::Bar.include ModuleSpecs::SingletonOnModuleCase::Foo - ModuleSpecs::SingletonOnModuleCase::Bar.included_called?.should == true + ModuleSpecs::SingletonOnModuleCase::Bar.should.included_called? end end diff --git a/spec/ruby/core/module/name_spec.rb b/spec/ruby/core/module/name_spec.rb index 9a4730313f..ae8037555b 100644 --- a/spec/ruby/core/module/name_spec.rb +++ b/spec/ruby/core/module/name_spec.rb @@ -122,7 +122,7 @@ describe "Module#name" do ruby_version_is "2.7" do it "returns a frozen String" do - ModuleSpecs.name.frozen?.should == true + ModuleSpecs.name.should.frozen? end it "always returns the same String for a given Module" do diff --git a/spec/ruby/core/module/singleton_class_spec.rb b/spec/ruby/core/module/singleton_class_spec.rb index b9f78eeb21..052755b73b 100644 --- a/spec/ruby/core/module/singleton_class_spec.rb +++ b/spec/ruby/core/module/singleton_class_spec.rb @@ -3,25 +3,25 @@ require_relative '../../spec_helper' describe "Module#singleton_class?" do it "returns true for singleton classes" do xs = self.singleton_class - xs.singleton_class?.should == true + xs.should.singleton_class? end it "returns false for other classes" do c = Class.new - c.singleton_class?.should == false + c.should_not.singleton_class? end describe "with singleton values" do it "returns false for nil's singleton class" do - NilClass.singleton_class?.should == false + NilClass.should_not.singleton_class? end it "returns false for true's singleton class" do - TrueClass.singleton_class?.should == false + TrueClass.should_not.singleton_class? end it "returns false for false's singleton class" do - FalseClass.singleton_class?.should == false + FalseClass.should_not.singleton_class? end end end diff --git a/spec/ruby/core/nil/nil_spec.rb b/spec/ruby/core/nil/nil_spec.rb index 47db0c5cf0..2cf97621c6 100644 --- a/spec/ruby/core/nil/nil_spec.rb +++ b/spec/ruby/core/nil/nil_spec.rb @@ -2,6 +2,6 @@ require_relative '../../spec_helper' describe "NilClass#nil?" do it "returns true" do - nil.nil?.should == true + nil.should.nil? end end diff --git a/spec/ruby/core/nil/to_s_spec.rb b/spec/ruby/core/nil/to_s_spec.rb index 4b61f589f7..283d26477a 100644 --- a/spec/ruby/core/nil/to_s_spec.rb +++ b/spec/ruby/core/nil/to_s_spec.rb @@ -7,7 +7,7 @@ describe "NilClass#to_s" do ruby_version_is "2.7" do it "returns a frozen string" do - nil.to_s.frozen?.should == true + nil.to_s.should.frozen? end it "always returns the same string" do diff --git a/spec/ruby/core/numeric/integer_spec.rb b/spec/ruby/core/numeric/integer_spec.rb index 5d4bf00360..adbac4d7aa 100644 --- a/spec/ruby/core/numeric/integer_spec.rb +++ b/spec/ruby/core/numeric/integer_spec.rb @@ -3,6 +3,6 @@ require_relative 'fixtures/classes' describe "Numeric#integer?" do it "returns false" do - NumericSpecs::Subclass.new.integer?.should == false + NumericSpecs::Subclass.new.should_not.integer? end end diff --git a/spec/ruby/core/numeric/negative_spec.rb b/spec/ruby/core/numeric/negative_spec.rb index da464a9094..9c6f95fd87 100644 --- a/spec/ruby/core/numeric/negative_spec.rb +++ b/spec/ruby/core/numeric/negative_spec.rb @@ -31,11 +31,11 @@ describe "Numeric#negative?" do it "returns true if self is less than 0" do @obj.should_receive(:<).with(0).and_return(true) - @obj.negative?.should == true + @obj.should.negative? end it "returns false if self is greater than 0" do @obj.should_receive(:<).with(0).and_return(false) - @obj.negative?.should == false + @obj.should_not.negative? end end diff --git a/spec/ruby/core/numeric/positive_spec.rb b/spec/ruby/core/numeric/positive_spec.rb index 8f98fbfa26..3b831b4d34 100644 --- a/spec/ruby/core/numeric/positive_spec.rb +++ b/spec/ruby/core/numeric/positive_spec.rb @@ -31,11 +31,11 @@ describe "Numeric#positive?" do it "returns true if self is greater than 0" do @obj.should_receive(:>).with(0).and_return(true) - @obj.positive?.should == true + @obj.should.positive? end it "returns false if self is less than 0" do @obj.should_receive(:>).with(0).and_return(false) - @obj.positive?.should == false + @obj.should_not.positive? end end diff --git a/spec/ruby/core/numeric/real_spec.rb b/spec/ruby/core/numeric/real_spec.rb index caa8dcec6d..2d2499bcce 100644 --- a/spec/ruby/core/numeric/real_spec.rb +++ b/spec/ruby/core/numeric/real_spec.rb @@ -32,6 +32,6 @@ end describe "Numeric#real?" do it "returns true" do - NumericSpecs::Subclass.new.real?.should == true + NumericSpecs::Subclass.new.should.real? end end diff --git a/spec/ruby/core/numeric/zero_spec.rb b/spec/ruby/core/numeric/zero_spec.rb index 9de71d1dc9..0fb7619bcd 100644 --- a/spec/ruby/core/numeric/zero_spec.rb +++ b/spec/ruby/core/numeric/zero_spec.rb @@ -8,11 +8,11 @@ describe "Numeric#zero?" do it "returns true if self is 0" do @obj.should_receive(:==).with(0).and_return(true) - @obj.zero?.should == true + @obj.should.zero? end it "returns false if self is not 0" do @obj.should_receive(:==).with(0).and_return(false) - @obj.zero?.should == false + @obj.should_not.zero? end end diff --git a/spec/ruby/core/proc/compose_spec.rb b/spec/ruby/core/proc/compose_spec.rb index ef9c125ae9..efdbdeacf4 100644 --- a/spec/ruby/core/proc/compose_spec.rb +++ b/spec/ruby/core/proc/compose_spec.rb @@ -35,7 +35,7 @@ ruby_version_is "2.6" do g = proc { |x| x + x } (f << g).is_a?(Proc).should == true - (f << g).lambda?.should == false + (f << g).should_not.lambda? end ruby_version_is(''...'2.8') do @@ -44,7 +44,7 @@ ruby_version_is "2.6" do g = -> x { x + x } (f << g).is_a?(Proc).should == true - (f << g).lambda?.should == false + (f << g).should_not.lambda? end it "is a lambda when self is lambda" do @@ -52,7 +52,7 @@ ruby_version_is "2.6" do g = proc { |x| x + x } (f << g).is_a?(Proc).should == true - (f << g).lambda?.should == true + (f << g).should.lambda? end end @@ -63,8 +63,8 @@ ruby_version_is "2.6" do lambda_proc = -> x { x } (f << g).is_a?(Proc).should == true - (f << g).lambda?.should == false - (f << lambda_proc).lambda?.should == true + (f << g).should_not.lambda? + (f << lambda_proc).should.lambda? end end @@ -118,7 +118,7 @@ ruby_version_is "2.6" do g = proc { |x| x + x } (f >> g).is_a?(Proc).should == true - (f >> g).lambda?.should == false + (f >> g).should_not.lambda? end it "is a Proc when other is lambda" do @@ -126,7 +126,7 @@ ruby_version_is "2.6" do g = -> x { x + x } (f >> g).is_a?(Proc).should == true - (f >> g).lambda?.should == false + (f >> g).should_not.lambda? end it "is a lambda when self is lambda" do @@ -134,7 +134,7 @@ ruby_version_is "2.6" do g = proc { |x| x + x } (f >> g).is_a?(Proc).should == true - (f >> g).lambda?.should == true + (f >> g).should.lambda? end it "may accept multiple arguments" do diff --git a/spec/ruby/core/range/dup_spec.rb b/spec/ruby/core/range/dup_spec.rb index d1c029c6b7..6c9d0c954a 100644 --- a/spec/ruby/core/range/dup_spec.rb +++ b/spec/ruby/core/range/dup_spec.rb @@ -5,11 +5,11 @@ describe "Range#dup" do copy = (1..3).dup copy.begin.should == 1 copy.end.should == 3 - copy.exclude_end?.should == false + copy.should_not.exclude_end? copy = ("a"..."z").dup copy.begin.should == "a" copy.end.should == "z" - copy.exclude_end?.should == true + copy.should.exclude_end? end end diff --git a/spec/ruby/core/range/exclude_end_spec.rb b/spec/ruby/core/range/exclude_end_spec.rb index a209603d18..c4006fea78 100644 --- a/spec/ruby/core/range/exclude_end_spec.rb +++ b/spec/ruby/core/range/exclude_end_spec.rb @@ -2,18 +2,18 @@ require_relative '../../spec_helper' describe "Range#exclude_end?" do it "returns false if the range does not exclude the end value" do - (-2..2).exclude_end?.should == false - ('A'..'B').exclude_end?.should == false - (0.5..2.4).exclude_end?.should == false - (0xfffd..0xffff).exclude_end?.should == false - Range.new(0, 1).exclude_end?.should == false + (-2..2).should_not.exclude_end? + ('A'..'B').should_not.exclude_end? + (0.5..2.4).should_not.exclude_end? + (0xfffd..0xffff).should_not.exclude_end? + Range.new(0, 1).should_not.exclude_end? end it "returns true if the range excludes the end value" do - (0...5).exclude_end?.should == true - ('A'...'B').exclude_end?.should == true - (0.5...2.4).exclude_end?.should == true - (0xfffd...0xffff).exclude_end?.should == true - Range.new(0, 1, true).exclude_end?.should == true + (0...5).should.exclude_end? + ('A'...'B').should.exclude_end? + (0.5...2.4).should.exclude_end? + (0xfffd...0xffff).should.exclude_end? + Range.new(0, 1, true).should.exclude_end? end end diff --git a/spec/ruby/core/regexp/casefold_spec.rb b/spec/ruby/core/regexp/casefold_spec.rb index d84a2d63c9..d36467a989 100644 --- a/spec/ruby/core/regexp/casefold_spec.rb +++ b/spec/ruby/core/regexp/casefold_spec.rb @@ -2,7 +2,7 @@ require_relative '../../spec_helper' describe "Regexp#casefold?" do it "returns the value of the case-insensitive flag" do - /abc/i.casefold?.should == true - /xyz/.casefold?.should == false + /abc/i.should.casefold? + /xyz/.should_not.casefold? end end diff --git a/spec/ruby/core/signal/trap_spec.rb b/spec/ruby/core/signal/trap_spec.rb index 91ce1f1348..831a5ee23e 100644 --- a/spec/ruby/core/signal/trap_spec.rb +++ b/spec/ruby/core/signal/trap_spec.rb @@ -155,7 +155,7 @@ platform_is_not :windows do out = ruby_exe(code) status = $? out.should == "nil\n" - status.signaled?.should == true + status.should.signaled? status.termsig.should be_kind_of(Integer) Signal.signame(status.termsig).should == "PIPE" end diff --git a/spec/ruby/core/string/capitalize_spec.rb b/spec/ruby/core/string/capitalize_spec.rb index 66d3b75f48..e6cf365ac3 100644 --- a/spec/ruby/core/string/capitalize_spec.rb +++ b/spec/ruby/core/string/capitalize_spec.rb @@ -14,8 +14,8 @@ describe "String#capitalize" do ruby_version_is ''...'2.7' do it "taints resulting string when self is tainted" do - "".taint.capitalize.tainted?.should == true - "hello".taint.capitalize.tainted?.should == true + "".taint.capitalize.should.tainted? + "hello".taint.capitalize.should.tainted? end end diff --git a/spec/ruby/core/string/center_spec.rb b/spec/ruby/core/string/center_spec.rb index 0284fc28dc..8a4be0a81e 100644 --- a/spec/ruby/core/string/center_spec.rb +++ b/spec/ruby/core/string/center_spec.rb @@ -49,11 +49,11 @@ describe "String#center with length, padding" do ruby_version_is ''...'2.7' do it "taints result when self or padstr is tainted" do - "x".taint.center(4).tainted?.should == true - "x".taint.center(0).tainted?.should == true - "".taint.center(0).tainted?.should == true - "x".taint.center(4, "*").tainted?.should == true - "x".center(4, "*".taint).tainted?.should == true + "x".taint.center(4).should.tainted? + "x".taint.center(0).should.tainted? + "".taint.center(0).should.tainted? + "x".taint.center(4, "*").should.tainted? + "x".center(4, "*".taint).should.tainted? end end diff --git a/spec/ruby/core/string/chop_spec.rb b/spec/ruby/core/string/chop_spec.rb index e9cd8f51d2..582d3c58c5 100644 --- a/spec/ruby/core/string/chop_spec.rb +++ b/spec/ruby/core/string/chop_spec.rb @@ -51,13 +51,13 @@ describe "String#chop" do ruby_version_is ''...'2.7' do it "taints result when self is tainted" do - "hello".taint.chop.tainted?.should == true - "".taint.chop.tainted?.should == true + "hello".taint.chop.should.tainted? + "".taint.chop.should.tainted? end it "untrusts result when self is untrusted" do - "hello".untrust.chop.untrusted?.should == true - "".untrust.chop.untrusted?.should == true + "hello".untrust.chop.should.untrusted? + "".untrust.chop.should.untrusted? end end diff --git a/spec/ruby/core/string/crypt_spec.rb b/spec/ruby/core/string/crypt_spec.rb index 6a9a4ae235..b947702492 100644 --- a/spec/ruby/core/string/crypt_spec.rb +++ b/spec/ruby/core/string/crypt_spec.rb @@ -33,10 +33,10 @@ describe "String#crypt" do tainted_salt.taint tainted_str.taint - "mypassword".crypt("$2a$04$0WVaz0pV3jzfZ5G5tpmHWu").tainted?.should == false - tainted_str.crypt("$2a$04$0WVaz0pV3jzfZ5G5tpmHWu").tainted?.should == true - "mypassword".crypt(tainted_salt).tainted?.should == true - tainted_str.crypt(tainted_salt).tainted?.should == true + "mypassword".crypt("$2a$04$0WVaz0pV3jzfZ5G5tpmHWu").should_not.tainted? + tainted_str.crypt("$2a$04$0WVaz0pV3jzfZ5G5tpmHWu").should.tainted? + "mypassword".crypt(tainted_salt).should.tainted? + tainted_str.crypt(tainted_salt).should.tainted? end end @@ -93,10 +93,10 @@ describe "String#crypt" do tainted_salt.taint tainted_str.taint - "hello".crypt("aa").tainted?.should == false - tainted_str.crypt("aa").tainted?.should == true - "hello".crypt(tainted_salt).tainted?.should == true - tainted_str.crypt(tainted_salt).tainted?.should == true + "hello".crypt("aa").should_not.tainted? + tainted_str.crypt("aa").should.tainted? + "hello".crypt(tainted_salt).should.tainted? + tainted_str.crypt(tainted_salt).should.tainted? end end diff --git a/spec/ruby/core/string/delete_prefix_spec.rb b/spec/ruby/core/string/delete_prefix_spec.rb index fb00d808b2..bd5b56a312 100644 --- a/spec/ruby/core/string/delete_prefix_spec.rb +++ b/spec/ruby/core/string/delete_prefix_spec.rb @@ -23,8 +23,8 @@ describe "String#delete_prefix" do ruby_version_is ''...'2.7' do it "taints resulting strings when other is tainted" do - 'hello'.taint.delete_prefix('hell').tainted?.should == true - 'hello'.taint.delete_prefix('').tainted?.should == true + 'hello'.taint.delete_prefix('hell').should.tainted? + 'hello'.taint.delete_prefix('').should.tainted? end end diff --git a/spec/ruby/core/string/delete_spec.rb b/spec/ruby/core/string/delete_spec.rb index ded63f1719..b6e54f8386 100644 --- a/spec/ruby/core/string/delete_spec.rb +++ b/spec/ruby/core/string/delete_spec.rb @@ -70,10 +70,10 @@ describe "String#delete" do ruby_version_is ''...'2.7' do it "taints result when self is tainted" do - "hello".taint.delete("e").tainted?.should == true - "hello".taint.delete("a-z").tainted?.should == true + "hello".taint.delete("e").should.tainted? + "hello".taint.delete("a-z").should.tainted? - "hello".delete("e".taint).tainted?.should == false + "hello".delete("e".taint).should_not.tainted? end end diff --git a/spec/ruby/core/string/delete_suffix_spec.rb b/spec/ruby/core/string/delete_suffix_spec.rb index d5b6880193..dbb5f9df9e 100644 --- a/spec/ruby/core/string/delete_suffix_spec.rb +++ b/spec/ruby/core/string/delete_suffix_spec.rb @@ -23,8 +23,8 @@ describe "String#delete_suffix" do ruby_version_is ''...'2.7' do it "taints resulting strings when other is tainted" do - 'hello'.taint.delete_suffix('ello').tainted?.should == true - 'hello'.taint.delete_suffix('').tainted?.should == true + 'hello'.taint.delete_suffix('ello').should.tainted? + 'hello'.taint.delete_suffix('').should.tainted? end end diff --git a/spec/ruby/core/string/downcase_spec.rb b/spec/ruby/core/string/downcase_spec.rb index 32e04e8a2c..8c840bdcc4 100644 --- a/spec/ruby/core/string/downcase_spec.rb +++ b/spec/ruby/core/string/downcase_spec.rb @@ -70,9 +70,9 @@ describe "String#downcase" do ruby_version_is ''...'2.7' do it "taints result when self is tainted" do - "".taint.downcase.tainted?.should == true - "x".taint.downcase.tainted?.should == true - "X".taint.downcase.tainted?.should == true + "".taint.downcase.should.tainted? + "x".taint.downcase.should.tainted? + "X".taint.downcase.should.tainted? end end diff --git a/spec/ruby/core/string/dump_spec.rb b/spec/ruby/core/string/dump_spec.rb index 260ee37adb..ebdd0167aa 100644 --- a/spec/ruby/core/string/dump_spec.rb +++ b/spec/ruby/core/string/dump_spec.rb @@ -5,18 +5,18 @@ require_relative 'fixtures/classes' describe "String#dump" do ruby_version_is ''...'2.7' do it "taints the result if self is tainted" do - "foo".taint.dump.tainted?.should == true - "foo\n".taint.dump.tainted?.should == true + "foo".taint.dump.should.tainted? + "foo\n".taint.dump.should.tainted? end it "untrusts the result if self is untrusted" do - "foo".untrust.dump.untrusted?.should == true - "foo\n".untrust.dump.untrusted?.should == true + "foo".untrust.dump.should.untrusted? + "foo\n".untrust.dump.should.untrusted? end end it "does not take into account if a string is frozen" do - "foo".freeze.dump.frozen?.should == false + "foo".freeze.dump.should_not.frozen? end it "returns a subclass instance" do diff --git a/spec/ruby/core/string/element_set_spec.rb b/spec/ruby/core/string/element_set_spec.rb index e375b4570e..641d46bc91 100644 --- a/spec/ruby/core/string/element_set_spec.rb +++ b/spec/ruby/core/string/element_set_spec.rb @@ -18,11 +18,11 @@ describe "String#[]= with Fixnum index" do it "taints self if other_str is tainted" do a = "hello" a[0] = "".taint - a.tainted?.should == true + a.should.tainted? a = "hello" a[0] = "x".taint - a.tainted?.should == true + a.should.tainted? end end @@ -491,11 +491,11 @@ describe "String#[]= with Fixnum index, count" do it "taints self if other_str is tainted" do a = "hello" a[0, 0] = "".taint - a.tainted?.should == true + a.should.tainted? a = "hello" a[1, 4] = "x".taint - a.tainted?.should == true + a.should.tainted? end end diff --git a/spec/ruby/core/string/empty_spec.rb b/spec/ruby/core/string/empty_spec.rb index fb52070723..8e53a16afc 100644 --- a/spec/ruby/core/string/empty_spec.rb +++ b/spec/ruby/core/string/empty_spec.rb @@ -3,10 +3,10 @@ require_relative 'fixtures/classes' describe "String#empty?" do it "returns true if the string has a length of zero" do - "hello".empty?.should == false - " ".empty?.should == false - "\x00".empty?.should == false - "".empty?.should == true - StringSpecs::MyString.new("").empty?.should == true + "hello".should_not.empty? + " ".should_not.empty? + "\x00".should_not.empty? + "".should.empty? + StringSpecs::MyString.new("").should.empty? end end diff --git a/spec/ruby/core/string/gsub_spec.rb b/spec/ruby/core/string/gsub_spec.rb index 8193464d48..23e0ad2260 100644 --- a/spec/ruby/core/string/gsub_spec.rb +++ b/spec/ruby/core/string/gsub_spec.rb @@ -171,14 +171,14 @@ describe "String#gsub with pattern and replacement" do hello_t.taint; a_t.taint; empty_t.taint - hello_t.gsub(/./, a).tainted?.should == true - hello_t.gsub(/./, empty).tainted?.should == true + hello_t.gsub(/./, a).should.tainted? + hello_t.gsub(/./, empty).should.tainted? - hello.gsub(/./, a_t).tainted?.should == true - hello.gsub(/./, empty_t).tainted?.should == true - hello.gsub(//, empty_t).tainted?.should == true + hello.gsub(/./, a_t).should.tainted? + hello.gsub(/./, empty_t).should.tainted? + hello.gsub(//, empty_t).should.tainted? - hello.gsub(//.taint, "foo").tainted?.should == false + hello.gsub(//.taint, "foo").should_not.tainted? end end @@ -199,14 +199,14 @@ describe "String#gsub with pattern and replacement" do hello_t.untrust; a_t.untrust; empty_t.untrust - hello_t.gsub(/./, a).untrusted?.should == true - hello_t.gsub(/./, empty).untrusted?.should == true + hello_t.gsub(/./, a).should.untrusted? + hello_t.gsub(/./, empty).should.untrusted? - hello.gsub(/./, a_t).untrusted?.should == true - hello.gsub(/./, empty_t).untrusted?.should == true - hello.gsub(//, empty_t).untrusted?.should == true + hello.gsub(/./, a_t).should.untrusted? + hello.gsub(/./, empty_t).should.untrusted? + hello.gsub(//, empty_t).should.untrusted? - hello.gsub(//.untrust, "foo").untrusted?.should == false + hello.gsub(//.untrust, "foo").should_not.untrusted? end end @@ -521,14 +521,14 @@ describe "String#gsub with pattern and block" do hello_t.untrust; a_t.untrust; empty_t.untrust - hello_t.gsub(/./) { a }.untrusted?.should == true - hello_t.gsub(/./) { empty }.untrusted?.should == true + hello_t.gsub(/./) { a }.should.untrusted? + hello_t.gsub(/./) { empty }.should.untrusted? - hello.gsub(/./) { a_t }.untrusted?.should == true - hello.gsub(/./) { empty_t }.untrusted?.should == true - hello.gsub(//) { empty_t }.untrusted?.should == true + hello.gsub(/./) { a_t }.should.untrusted? + hello.gsub(/./) { empty_t }.should.untrusted? + hello.gsub(//) { empty_t }.should.untrusted? - hello.gsub(//.untrust) { "foo" }.untrusted?.should == false + hello.gsub(//.untrust) { "foo" }.should_not.untrusted? end end @@ -594,14 +594,14 @@ describe "String#gsub! with pattern and replacement" do ruby_version_is ''...'2.7' do it "taints self if replacement is tainted" do a = "hello" - a.gsub!(/./.taint, "foo").tainted?.should == false - a.gsub!(/./, "foo".taint).tainted?.should == true + a.gsub!(/./.taint, "foo").should_not.tainted? + a.gsub!(/./, "foo".taint).should.tainted? end it "untrusts self if replacement is untrusted" do a = "hello" - a.gsub!(/./.untrust, "foo").untrusted?.should == false - a.gsub!(/./, "foo".untrust).untrusted?.should == true + a.gsub!(/./.untrust, "foo").should_not.untrusted? + a.gsub!(/./, "foo".untrust).should.untrusted? end end @@ -633,14 +633,14 @@ describe "String#gsub! with pattern and block" do ruby_version_is ''...'2.7' do it "taints self if block's result is tainted" do a = "hello" - a.gsub!(/./.taint) { "foo" }.tainted?.should == false - a.gsub!(/./) { "foo".taint }.tainted?.should == true + a.gsub!(/./.taint) { "foo" }.should_not.tainted? + a.gsub!(/./) { "foo".taint }.should.tainted? end it "untrusts self if block's result is untrusted" do a = "hello" - a.gsub!(/./.untrust) { "foo" }.untrusted?.should == false - a.gsub!(/./) { "foo".untrust }.untrusted?.should == true + a.gsub!(/./.untrust) { "foo" }.should_not.untrusted? + a.gsub!(/./) { "foo".untrust }.should.untrusted? end end diff --git a/spec/ruby/core/string/insert_spec.rb b/spec/ruby/core/string/insert_spec.rb index b26845419f..752cbb2f37 100644 --- a/spec/ruby/core/string/insert_spec.rb +++ b/spec/ruby/core/string/insert_spec.rb @@ -44,12 +44,12 @@ describe "String#insert with index, other" do ruby_version_is ''...'2.7' do it "taints self if string to insert is tainted" do str = "abcd" - str.insert(0, "T".taint).tainted?.should == true + str.insert(0, "T".taint).should.tainted? str = "abcd" other = mock('T') def other.to_str() "T".taint end - str.insert(0, other).tainted?.should == true + str.insert(0, other).should.tainted? end end diff --git a/spec/ruby/core/string/inspect_spec.rb b/spec/ruby/core/string/inspect_spec.rb index e63d89ead5..9818796c83 100644 --- a/spec/ruby/core/string/inspect_spec.rb +++ b/spec/ruby/core/string/inspect_spec.rb @@ -5,13 +5,13 @@ require_relative 'fixtures/classes' describe "String#inspect" do ruby_version_is ''...'2.7' do it "taints the result if self is tainted" do - "foo".taint.inspect.tainted?.should == true - "foo\n".taint.inspect.tainted?.should == true + "foo".taint.inspect.should.tainted? + "foo\n".taint.inspect.should.tainted? end it "untrusts the result if self is untrusted" do - "foo".untrust.inspect.untrusted?.should == true - "foo\n".untrust.inspect.untrusted?.should == true + "foo".untrust.inspect.should.untrusted? + "foo\n".untrust.inspect.should.untrusted? end end diff --git a/spec/ruby/core/string/ljust_spec.rb b/spec/ruby/core/string/ljust_spec.rb index f377e39775..481ef77ca8 100644 --- a/spec/ruby/core/string/ljust_spec.rb +++ b/spec/ruby/core/string/ljust_spec.rb @@ -33,11 +33,11 @@ describe "String#ljust with length, padding" do ruby_version_is ''...'2.7' do it "taints result when self or padstr is tainted" do - "x".taint.ljust(4).tainted?.should == true - "x".taint.ljust(0).tainted?.should == true - "".taint.ljust(0).tainted?.should == true - "x".taint.ljust(4, "*").tainted?.should == true - "x".ljust(4, "*".taint).tainted?.should == true + "x".taint.ljust(4).should.tainted? + "x".taint.ljust(0).should.tainted? + "".taint.ljust(0).should.tainted? + "x".taint.ljust(4, "*").should.tainted? + "x".ljust(4, "*".taint).should.tainted? end end diff --git a/spec/ruby/core/string/lstrip_spec.rb b/spec/ruby/core/string/lstrip_spec.rb index 902d660455..12c7b13200 100644 --- a/spec/ruby/core/string/lstrip_spec.rb +++ b/spec/ruby/core/string/lstrip_spec.rb @@ -16,9 +16,9 @@ describe "String#lstrip" do ruby_version_is ''...'2.7' do it "taints the result when self is tainted" do - "".taint.lstrip.tainted?.should == true - "ok".taint.lstrip.tainted?.should == true - " ok".taint.lstrip.tainted?.should == true + "".taint.lstrip.should.tainted? + "ok".taint.lstrip.should.tainted? + " ok".taint.lstrip.should.tainted? end end end diff --git a/spec/ruby/core/string/modulo_spec.rb b/spec/ruby/core/string/modulo_spec.rb index ad4b85e3c3..dc11ced4e2 100644 --- a/spec/ruby/core/string/modulo_spec.rb +++ b/spec/ruby/core/string/modulo_spec.rb @@ -319,8 +319,8 @@ describe "String#%" do subcls_format.taint format.taint - (format % universal).tainted?.should == true - (subcls_format % universal).tainted?.should == true + (format % universal).should.tainted? + (subcls_format % universal).should.tainted? end end end @@ -583,12 +583,12 @@ describe "String#%" do obj = mock('x') def obj.inspect() "x".taint end - ("%p" % obj).tainted?.should == true + ("%p" % obj).should.tainted? obj = mock('x'); obj.taint def obj.inspect() "x" end - ("%p" % obj).tainted?.should == false + ("%p" % obj).should_not.tainted? end end @@ -622,8 +622,8 @@ describe "String#%" do ruby_version_is ''...'2.7' do it "taints result for %s when argument is tainted" do - ("%s" % "x".taint).tainted?.should == true - ("%s" % mock('x').taint).tainted?.should == true + ("%s" % "x".taint).should.tainted? + ("%s" % mock('x').taint).should.tainted? end end @@ -789,7 +789,7 @@ describe "String#%" do ruby_version_is ''...'2.7' do it "doesn't taint the result for #{format} when argument is tainted" do - (format % "5".taint).tainted?.should == false + (format % "5".taint).should_not.tainted? end end end diff --git a/spec/ruby/core/string/reverse_spec.rb b/spec/ruby/core/string/reverse_spec.rb index 30d5385c83..cf4956a528 100644 --- a/spec/ruby/core/string/reverse_spec.rb +++ b/spec/ruby/core/string/reverse_spec.rb @@ -12,8 +12,8 @@ describe "String#reverse" do ruby_version_is ''...'2.7' do it "taints the result if self is tainted" do - "".taint.reverse.tainted?.should == true - "m".taint.reverse.tainted?.should == true + "".taint.reverse.should.tainted? + "m".taint.reverse.should.tainted? end end diff --git a/spec/ruby/core/string/rjust_spec.rb b/spec/ruby/core/string/rjust_spec.rb index 9285ecb6a7..bf39f4fdb9 100644 --- a/spec/ruby/core/string/rjust_spec.rb +++ b/spec/ruby/core/string/rjust_spec.rb @@ -33,11 +33,11 @@ describe "String#rjust with length, padding" do ruby_version_is ''...'2.7' do it "taints result when self or padstr is tainted" do - "x".taint.rjust(4).tainted?.should == true - "x".taint.rjust(0).tainted?.should == true - "".taint.rjust(0).tainted?.should == true - "x".taint.rjust(4, "*").tainted?.should == true - "x".rjust(4, "*".taint).tainted?.should == true + "x".taint.rjust(4).should.tainted? + "x".taint.rjust(0).should.tainted? + "".taint.rjust(0).should.tainted? + "x".taint.rjust(4, "*").should.tainted? + "x".rjust(4, "*".taint).should.tainted? end end diff --git a/spec/ruby/core/string/rstrip_spec.rb b/spec/ruby/core/string/rstrip_spec.rb index 0a01ffad73..57e1867956 100644 --- a/spec/ruby/core/string/rstrip_spec.rb +++ b/spec/ruby/core/string/rstrip_spec.rb @@ -16,9 +16,9 @@ describe "String#rstrip" do ruby_version_is ''...'2.7' do it "taints the result when self is tainted" do - "".taint.rstrip.tainted?.should == true - "ok".taint.rstrip.tainted?.should == true - "ok ".taint.rstrip.tainted?.should == true + "".taint.rstrip.should.tainted? + "ok".taint.rstrip.should.tainted? + "ok ".taint.rstrip.should.tainted? end end end diff --git a/spec/ruby/core/string/shared/chars.rb b/spec/ruby/core/string/shared/chars.rb index 9c7a4deb8b..1f045e4530 100644 --- a/spec/ruby/core/string/shared/chars.rb +++ b/spec/ruby/core/string/shared/chars.rb @@ -69,11 +69,11 @@ describe :string_chars, shared: true do str = "hello" str.send(@method) do |x| - x.tainted?.should == false + x.should_not.tainted? end str.dup.taint.send(@method) do |x| - x.tainted?.should == true + x.should.tainted? end end end diff --git a/spec/ruby/core/string/shared/concat.rb b/spec/ruby/core/string/shared/concat.rb index d127b08e9c..d6ffad7d4d 100644 --- a/spec/ruby/core/string/shared/concat.rb +++ b/spec/ruby/core/string/shared/concat.rb @@ -41,13 +41,13 @@ describe :string_concat, shared: true do ruby_version_is ''...'2.7' do it "taints self if other is tainted" do - "x".send(@method, "".taint).tainted?.should == true - "x".send(@method, "y".taint).tainted?.should == true + "x".send(@method, "".taint).should.tainted? + "x".send(@method, "y".taint).should.tainted? end it "untrusts self if other is untrusted" do - "x".send(@method, "".untrust).untrusted?.should == true - "x".send(@method, "y".untrust).untrusted?.should == true + "x".send(@method, "".untrust).should.untrusted? + "x".send(@method, "y".untrust).should.untrusted? end end diff --git a/spec/ruby/core/string/shared/each_line.rb b/spec/ruby/core/string/shared/each_line.rb index c82e63cfe8..156565ff13 100644 --- a/spec/ruby/core/string/shared/each_line.rb +++ b/spec/ruby/core/string/shared/each_line.rb @@ -42,9 +42,9 @@ describe :string_each_line, shared: true do ruby_version_is ''...'2.7' do it "taints substrings that are passed to the block if self is tainted" do - "one\ntwo\r\nthree".taint.send(@method) { |s| s.tainted?.should == true } + "one\ntwo\r\nthree".taint.send(@method) { |s| s.should.tainted? } - "x.y.".send(@method, ".".taint) { |s| s.tainted?.should == false } + "x.y.".send(@method, ".".taint) { |s| s.should_not.tainted? } end end diff --git a/spec/ruby/core/string/shared/replace.rb b/spec/ruby/core/string/shared/replace.rb index 3c5a15e12d..8dfac49f02 100644 --- a/spec/ruby/core/string/shared/replace.rb +++ b/spec/ruby/core/string/shared/replace.rb @@ -15,28 +15,28 @@ describe :string_replace, shared: true do a = "" b = "".taint a.send(@method, b) - a.tainted?.should == true + a.should.tainted? end it "does not untaint self if other is untainted" do a = "".taint b = "" a.send(@method, b) - a.tainted?.should == true + a.should.tainted? end it "untrusts self if other is untrusted" do a = "" b = "".untrust a.send(@method, b) - a.untrusted?.should == true + a.should.untrusted? end it "does not trust self if other is trusted" do a = "".untrust b = "" a.send(@method, b) - a.untrusted?.should == true + a.should.untrusted? end end diff --git a/spec/ruby/core/string/shared/slice.rb b/spec/ruby/core/string/shared/slice.rb index 1c438bc48d..6b6f37217a 100644 --- a/spec/ruby/core/string/shared/slice.rb +++ b/spec/ruby/core/string/shared/slice.rb @@ -85,9 +85,9 @@ describe :string_slice_index_length, shared: true do str = "hello world" str.taint - str.send(@method, 0,0).tainted?.should == true - str.send(@method, 0,1).tainted?.should == true - str.send(@method, 2,1).tainted?.should == true + str.send(@method, 0,0).should.tainted? + str.send(@method, 0,1).should.tainted? + str.send(@method, 2,1).should.tainted? end end @@ -243,12 +243,12 @@ describe :string_slice_range, shared: true do str = "hello world" str.taint - str.send(@method, 0..0).tainted?.should == true - str.send(@method, 0...0).tainted?.should == true - str.send(@method, 0..1).tainted?.should == true - str.send(@method, 0...1).tainted?.should == true - str.send(@method, 2..3).tainted?.should == true - str.send(@method, 2..0).tainted?.should == true + str.send(@method, 0..0).should.tainted? + str.send(@method, 0...0).should.tainted? + str.send(@method, 0..1).should.tainted? + str.send(@method, 0...1).should.tainted? + str.send(@method, 2..3).should.tainted? + str.send(@method, 2..0).should.tainted? end end @@ -338,7 +338,7 @@ describe :string_slice_regexp, shared: true do tainted_re = /./ tainted_re.taint - str.send(@method, tainted_re).tainted?.should == true + str.send(@method, tainted_re).should.tainted? end end @@ -395,9 +395,9 @@ describe :string_slice_regexp_index, shared: true do tainted_re = /(.)(.)(.)/ tainted_re.taint - str.send(@method, tainted_re, 0).tainted?.should == true - str.send(@method, tainted_re, 1).tainted?.should == true - str.send(@method, tainted_re, -1).tainted?.should == true + str.send(@method, tainted_re, 0).should.tainted? + str.send(@method, tainted_re, 1).should.tainted? + str.send(@method, tainted_re, -1).should.tainted? end end diff --git a/spec/ruby/core/string/shared/succ.rb b/spec/ruby/core/string/shared/succ.rb index 346ccee409..7ca488dd88 100644 --- a/spec/ruby/core/string/shared/succ.rb +++ b/spec/ruby/core/string/shared/succ.rb @@ -68,7 +68,7 @@ describe :string_succ, shared: true do ruby_version_is ''...'2.7' do it "taints the result if self is tainted" do ["", "a", "z", "Z", "9", "\xFF", "\xFF\xFF"].each do |s| - s.taint.send(@method).tainted?.should == true + s.taint.send(@method).should.tainted? end end end diff --git a/spec/ruby/core/string/shared/to_s.rb b/spec/ruby/core/string/shared/to_s.rb index 36283be4d0..b8c9b8ab44 100644 --- a/spec/ruby/core/string/shared/to_s.rb +++ b/spec/ruby/core/string/shared/to_s.rb @@ -13,8 +13,8 @@ describe :string_to_s, shared: true do ruby_version_is ''...'2.7' do it "taints the result when self is tainted" do - "x".taint.send(@method).tainted?.should == true - StringSpecs::MyString.new("x").taint.send(@method).tainted?.should == true + "x".taint.send(@method).should.tainted? + StringSpecs::MyString.new("x").taint.send(@method).should.tainted? end end end diff --git a/spec/ruby/core/string/shared/to_sym.rb b/spec/ruby/core/string/shared/to_sym.rb index 1180d64712..416f302aef 100644 --- a/spec/ruby/core/string/shared/to_sym.rb +++ b/spec/ruby/core/string/shared/to_sym.rb @@ -55,7 +55,7 @@ describe :string_to_sym, shared: true do it "raises an EncodingError for UTF-8 String containing invalid bytes" do invalid_utf8 = "\xC3" - invalid_utf8.valid_encoding?.should == false + invalid_utf8.should_not.valid_encoding? -> { invalid_utf8.send(@method) }.should raise_error(EncodingError, /invalid/) diff --git a/spec/ruby/core/string/slice_spec.rb b/spec/ruby/core/string/slice_spec.rb index a34dd1b8d4..bd0a63971b 100644 --- a/spec/ruby/core/string/slice_spec.rb +++ b/spec/ruby/core/string/slice_spec.rb @@ -99,8 +99,8 @@ describe "String#slice! with index, length" do str = "hello world" str.taint - str.slice!(0, 0).tainted?.should == true - str.slice!(2, 1).tainted?.should == true + str.slice!(0, 0).should.tainted? + str.slice!(2, 1).should.tainted? end end @@ -191,8 +191,8 @@ describe "String#slice! Range" do str = "hello world" str.taint - str.slice!(0..0).tainted?.should == true - str.slice!(2..3).tainted?.should == true + str.slice!(0..0).should.tainted? + str.slice!(2..3).should.tainted? end end @@ -288,14 +288,14 @@ describe "String#slice! with Regexp" do tainted_re = /./ tainted_re.taint - str.slice!(tainted_re).tainted?.should == true + str.slice!(tainted_re).should.tainted? end end it "doesn't taint self when regexp is tainted" do s = "hello" s.slice!(/./.taint) - s.tainted?.should == false + s.should_not.tainted? end end @@ -349,14 +349,14 @@ describe "String#slice! with Regexp, index" do tainted_re = /(.)(.)(.)/ tainted_re.taint - str.slice!(tainted_re, 1).tainted?.should == true + str.slice!(tainted_re, 1).should.tainted? end end it "doesn't taint self when regexp is tainted" do s = "hello" s.slice!(/(.)(.)/.taint, 1) - s.tainted?.should == false + s.should_not.tainted? end end diff --git a/spec/ruby/core/string/split_spec.rb b/spec/ruby/core/string/split_spec.rb index 8a740b04ca..34a50a5f13 100644 --- a/spec/ruby/core/string/split_spec.rb +++ b/spec/ruby/core/string/split_spec.rb @@ -189,11 +189,11 @@ describe "String#split with String" do ["", ".", " "].each do |pat| [-1, 0, 1, 2].each do |limit| str.dup.taint.split(pat).each do |x| - x.tainted?.should == true + x.should.tainted? end str.split(pat.dup.taint).each do |x| - x.tainted?.should == false + x.should_not.tainted? end end end diff --git a/spec/ruby/core/string/squeeze_spec.rb b/spec/ruby/core/string/squeeze_spec.rb index e54ed42b49..5a7fbb59de 100644 --- a/spec/ruby/core/string/squeeze_spec.rb +++ b/spec/ruby/core/string/squeeze_spec.rb @@ -56,11 +56,11 @@ describe "String#squeeze" do ruby_version_is ''...'2.7' do it "taints the result when self is tainted" do - "hello".taint.squeeze("e").tainted?.should == true - "hello".taint.squeeze("a-z").tainted?.should == true + "hello".taint.squeeze("e").should.tainted? + "hello".taint.squeeze("a-z").should.tainted? - "hello".squeeze("e".taint).tainted?.should == false - "hello".squeeze("l".taint).tainted?.should == false + "hello".squeeze("e".taint).should_not.tainted? + "hello".squeeze("l".taint).should_not.tainted? end end diff --git a/spec/ruby/core/string/strip_spec.rb b/spec/ruby/core/string/strip_spec.rb index 1838e07f32..252d4a9cc3 100644 --- a/spec/ruby/core/string/strip_spec.rb +++ b/spec/ruby/core/string/strip_spec.rb @@ -15,9 +15,9 @@ describe "String#strip" do ruby_version_is ''...'2.7' do it "taints the result when self is tainted" do - "".taint.strip.tainted?.should == true - "ok".taint.strip.tainted?.should == true - " ok ".taint.strip.tainted?.should == true + "".taint.strip.should.tainted? + "ok".taint.strip.should.tainted? + " ok ".taint.strip.should.tainted? end end end diff --git a/spec/ruby/core/string/sub_spec.rb b/spec/ruby/core/string/sub_spec.rb index f240cd8cff..80cf8622d5 100644 --- a/spec/ruby/core/string/sub_spec.rb +++ b/spec/ruby/core/string/sub_spec.rb @@ -148,14 +148,14 @@ describe "String#sub with pattern, replacement" do hello_t.taint; a_t.taint; empty_t.taint - hello_t.sub(/./, a).tainted?.should == true - hello_t.sub(/./, empty).tainted?.should == true + hello_t.sub(/./, a).should.tainted? + hello_t.sub(/./, empty).should.tainted? - hello.sub(/./, a_t).tainted?.should == true - hello.sub(/./, empty_t).tainted?.should == true - hello.sub(//, empty_t).tainted?.should == true + hello.sub(/./, a_t).should.tainted? + hello.sub(/./, empty_t).should.tainted? + hello.sub(//, empty_t).should.tainted? - hello.sub(//.taint, "foo").tainted?.should == false + hello.sub(//.taint, "foo").should_not.tainted? end end @@ -298,14 +298,14 @@ describe "String#sub with pattern and block" do hello_t.taint; a_t.taint; empty_t.taint - hello_t.sub(/./) { a }.tainted?.should == true - hello_t.sub(/./) { empty }.tainted?.should == true + hello_t.sub(/./) { a }.should.tainted? + hello_t.sub(/./) { empty }.should.tainted? - hello.sub(/./) { a_t }.tainted?.should == true - hello.sub(/./) { empty_t }.tainted?.should == true - hello.sub(//) { empty_t }.tainted?.should == true + hello.sub(/./) { a_t }.should.tainted? + hello.sub(/./) { empty_t }.should.tainted? + hello.sub(//) { empty_t }.should.tainted? - hello.sub(//.taint) { "foo" }.tainted?.should == false + hello.sub(//.taint) { "foo" }.should_not.tainted? end end end @@ -320,8 +320,8 @@ describe "String#sub! with pattern, replacement" do ruby_version_is ''...'2.7' do it "taints self if replacement is tainted" do a = "hello" - a.sub!(/./.taint, "foo").tainted?.should == false - a.sub!(/./, "foo".taint).tainted?.should == true + a.sub!(/./.taint, "foo").should_not.tainted? + a.sub!(/./, "foo".taint).should.tainted? end end @@ -370,8 +370,8 @@ describe "String#sub! with pattern and block" do ruby_version_is ''...'2.7' do it "taints self if block's result is tainted" do a = "hello" - a.sub!(/./.taint) { "foo" }.tainted?.should == false - a.sub!(/./) { "foo".taint }.tainted?.should == true + a.sub!(/./.taint) { "foo" }.should_not.tainted? + a.sub!(/./) { "foo".taint }.should.tainted? end end diff --git a/spec/ruby/core/string/swapcase_spec.rb b/spec/ruby/core/string/swapcase_spec.rb index d1e908d71d..0b50cc35c4 100644 --- a/spec/ruby/core/string/swapcase_spec.rb +++ b/spec/ruby/core/string/swapcase_spec.rb @@ -11,8 +11,8 @@ describe "String#swapcase" do ruby_version_is ''...'2.7' do it "taints resulting string when self is tainted" do - "".taint.swapcase.tainted?.should == true - "hello".taint.swapcase.tainted?.should == true + "".taint.swapcase.should.tainted? + "hello".taint.swapcase.should.tainted? end end diff --git a/spec/ruby/core/string/tr_s_spec.rb b/spec/ruby/core/string/tr_s_spec.rb index e004ab713c..cdf5667ea3 100644 --- a/spec/ruby/core/string/tr_s_spec.rb +++ b/spec/ruby/core/string/tr_s_spec.rb @@ -54,10 +54,10 @@ describe "String#tr_s" do ["h", "hello"].each do |str| tainted_str = str.dup.taint - tainted_str.tr_s("e", "a").tainted?.should == true + tainted_str.tr_s("e", "a").should.tainted? - str.tr_s("e".taint, "a").tainted?.should == false - str.tr_s("e", "a".taint).tainted?.should == false + str.tr_s("e".taint, "a").should_not.tainted? + str.tr_s("e", "a".taint).should_not.tainted? end end end diff --git a/spec/ruby/core/string/tr_spec.rb b/spec/ruby/core/string/tr_spec.rb index 0e4da398d5..212d06f679 100644 --- a/spec/ruby/core/string/tr_spec.rb +++ b/spec/ruby/core/string/tr_spec.rb @@ -66,10 +66,10 @@ describe "String#tr" do ["h", "hello"].each do |str| tainted_str = str.dup.taint - tainted_str.tr("e", "a").tainted?.should == true + tainted_str.tr("e", "a").should.tainted? - str.tr("e".taint, "a").tainted?.should == false - str.tr("e", "a".taint).tainted?.should == false + str.tr("e".taint, "a").should_not.tainted? + str.tr("e", "a".taint).should_not.tainted? end end end diff --git a/spec/ruby/core/string/uminus_spec.rb b/spec/ruby/core/string/uminus_spec.rb index 85b484b6df..91f91fdb1e 100644 --- a/spec/ruby/core/string/uminus_spec.rb +++ b/spec/ruby/core/string/uminus_spec.rb @@ -6,14 +6,14 @@ describe 'String#-@' do output = -input output.should equal(input) - output.frozen?.should == true + output.should.frozen? end it 'returns a frozen copy if the String is not frozen' do input = 'foo' output = -input - output.frozen?.should == true + output.should.frozen? output.should_not equal(input) output.should == 'foo' end diff --git a/spec/ruby/core/string/undump_spec.rb b/spec/ruby/core/string/undump_spec.rb index 81deb6fa58..b990aa25ee 100644 --- a/spec/ruby/core/string/undump_spec.rb +++ b/spec/ruby/core/string/undump_spec.rb @@ -5,16 +5,16 @@ require_relative 'fixtures/classes' describe "String#undump" do ruby_version_is ''...'2.7' do it "taints the result if self is tainted" do - '"foo"'.taint.undump.tainted?.should == true + '"foo"'.taint.undump.should.tainted? end it "untrusts the result if self is untrusted" do - '"foo"'.untrust.undump.untrusted?.should == true + '"foo"'.untrust.undump.should.untrusted? end end it "does not take into account if a string is frozen" do - '"foo"'.freeze.undump.frozen?.should == false + '"foo"'.freeze.undump.should_not.frozen? end it "always returns String instance" do diff --git a/spec/ruby/core/string/unicode_normalized_spec.rb b/spec/ruby/core/string/unicode_normalized_spec.rb index 25c810a98f..87f3740459 100644 --- a/spec/ruby/core/string/unicode_normalized_spec.rb +++ b/spec/ruby/core/string/unicode_normalized_spec.rb @@ -24,16 +24,16 @@ describe "String#unicode_normalized?" do end it "defaults to the nfc normalization form if no forms are specified" do - @nfc_normalized_str.unicode_normalized?.should == true - @nfd_normalized_str.unicode_normalized?.should == false + @nfc_normalized_str.should.unicode_normalized? + @nfd_normalized_str.should_not.unicode_normalized? end it "returns true if string is empty" do - "".unicode_normalized?.should == true + "".should.unicode_normalized? end it "returns true if string does not contain any unicode codepoints" do - "abc".unicode_normalized?.should == true + "abc".should.unicode_normalized? end it "raises an Encoding::CompatibilityError if the string is not in an unicode encoding" do diff --git a/spec/ruby/core/string/upcase_spec.rb b/spec/ruby/core/string/upcase_spec.rb index c440b1b0aa..13ebd09a95 100644 --- a/spec/ruby/core/string/upcase_spec.rb +++ b/spec/ruby/core/string/upcase_spec.rb @@ -67,9 +67,9 @@ describe "String#upcase" do ruby_version_is ''...'2.7' do it "taints result when self is tainted" do - "".taint.upcase.tainted?.should == true - "X".taint.upcase.tainted?.should == true - "x".taint.upcase.tainted?.should == true + "".taint.upcase.should.tainted? + "X".taint.upcase.should.tainted? + "x".taint.upcase.should.tainted? end end diff --git a/spec/ruby/core/string/uplus_spec.rb b/spec/ruby/core/string/uplus_spec.rb index a7402b4549..038b283c90 100644 --- a/spec/ruby/core/string/uplus_spec.rb +++ b/spec/ruby/core/string/uplus_spec.rb @@ -5,7 +5,7 @@ describe 'String#+@' do input = 'foo'.freeze output = +input - output.frozen?.should == false + output.should_not.frozen? output.should == 'foo' end diff --git a/spec/ruby/core/symbol/to_proc_spec.rb b/spec/ruby/core/symbol/to_proc_spec.rb index 6651022375..32f996d63c 100644 --- a/spec/ruby/core/symbol/to_proc_spec.rb +++ b/spec/ruby/core/symbol/to_proc_spec.rb @@ -15,7 +15,7 @@ describe "Symbol#to_proc" do ruby_version_is ""..."2.8" do it "returns a Proc with #lambda? false" do pr = :to_s.to_proc - pr.lambda?.should == false + pr.should_not.lambda? end it "produces a Proc with arity -1" do @@ -32,7 +32,7 @@ describe "Symbol#to_proc" do ruby_version_is "2.8" do it "returns a Proc with #lambda? true" do pr = :to_s.to_proc - pr.lambda?.should == true + pr.should.lambda? end it "produces a Proc with arity -2" do diff --git a/spec/ruby/core/systemexit/success_spec.rb b/spec/ruby/core/systemexit/success_spec.rb index 6d36509c80..ba2fd22ded 100644 --- a/spec/ruby/core/systemexit/success_spec.rb +++ b/spec/ruby/core/systemexit/success_spec.rb @@ -3,11 +3,11 @@ require_relative '../../spec_helper' describe "SystemExit#success?" do it "returns true when the status is 0" do s = SystemExit.new 0 - s.success?.should == true + s.should.success? end it "returns false when the status is not 0" do s = SystemExit.new 1 - s.success?.should == false + s.should_not.success? end end diff --git a/spec/ruby/core/thread/alive_spec.rb b/spec/ruby/core/thread/alive_spec.rb index d4ba149d87..c2f5f5371d 100644 --- a/spec/ruby/core/thread/alive_spec.rb +++ b/spec/ruby/core/thread/alive_spec.rb @@ -3,39 +3,39 @@ require_relative 'fixtures/classes' describe "Thread#alive?" do it "can check it's own status" do - ThreadSpecs.status_of_current_thread.alive?.should == true + ThreadSpecs.status_of_current_thread.should.alive? end it "describes a running thread" do - ThreadSpecs.status_of_running_thread.alive?.should == true + ThreadSpecs.status_of_running_thread.should.alive? end it "describes a sleeping thread" do - ThreadSpecs.status_of_sleeping_thread.alive?.should == true + ThreadSpecs.status_of_sleeping_thread.should.alive? end it "describes a blocked thread" do - ThreadSpecs.status_of_blocked_thread.alive?.should == true + ThreadSpecs.status_of_blocked_thread.should.alive? end it "describes a completed thread" do - ThreadSpecs.status_of_completed_thread.alive?.should == false + ThreadSpecs.status_of_completed_thread.should_not.alive? end it "describes a killed thread" do - ThreadSpecs.status_of_killed_thread.alive?.should == false + ThreadSpecs.status_of_killed_thread.should_not.alive? end it "describes a thread with an uncaught exception" do - ThreadSpecs.status_of_thread_with_uncaught_exception.alive?.should == false + ThreadSpecs.status_of_thread_with_uncaught_exception.should_not.alive? end it "describes a dying running thread" do - ThreadSpecs.status_of_dying_running_thread.alive?.should == true + ThreadSpecs.status_of_dying_running_thread.should.alive? end it "describes a dying sleeping thread" do - ThreadSpecs.status_of_dying_sleeping_thread.alive?.should == true + ThreadSpecs.status_of_dying_sleeping_thread.should.alive? end it "returns true for a killed but still running thread" do @@ -51,7 +51,7 @@ describe "Thread#alive?" do ThreadSpecs.spin_until_sleeping(t) t.kill - t.alive?.should == true + t.should.alive? exit = true t.join end diff --git a/spec/ruby/core/thread/new_spec.rb b/spec/ruby/core/thread/new_spec.rb index 3a57149381..47a836201c 100644 --- a/spec/ruby/core/thread/new_spec.rb +++ b/spec/ruby/core/thread/new_spec.rb @@ -58,13 +58,13 @@ describe "Thread.new" do m2 = Mutex.new t = Thread.new { m1.lock - m1.locked?.should == true + m1.should.locked? m2.lock - m2.locked?.should == true + m2.should.locked? } t.join - m1.locked?.should == false - m2.locked?.should == false + m1.should_not.locked? + m2.should_not.locked? end it "releases Mutexes held by the Thread when the Thread finishes, also with Mutex#synchronize" do @@ -75,9 +75,9 @@ describe "Thread.new" do m.lock } m.lock - m.locked?.should == true + m.should.locked? } t.join - m.locked?.should == false + m.should_not.locked? end end diff --git a/spec/ruby/core/thread/stop_spec.rb b/spec/ruby/core/thread/stop_spec.rb index 33cf8f7b5c..084ab46ef6 100644 --- a/spec/ruby/core/thread/stop_spec.rb +++ b/spec/ruby/core/thread/stop_spec.rb @@ -13,42 +13,42 @@ end describe "Thread#stop?" do it "can check it's own status" do - ThreadSpecs.status_of_current_thread.stop?.should == false + ThreadSpecs.status_of_current_thread.should_not.stop? end it "describes a running thread" do - ThreadSpecs.status_of_running_thread.stop?.should == false + ThreadSpecs.status_of_running_thread.should_not.stop? end it "describes a sleeping thread" do - ThreadSpecs.status_of_sleeping_thread.stop?.should == true + ThreadSpecs.status_of_sleeping_thread.should.stop? end it "describes a blocked thread" do - ThreadSpecs.status_of_blocked_thread.stop?.should == true + ThreadSpecs.status_of_blocked_thread.should.stop? end it "describes a completed thread" do - ThreadSpecs.status_of_completed_thread.stop?.should == true + ThreadSpecs.status_of_completed_thread.should.stop? end it "describes a killed thread" do - ThreadSpecs.status_of_killed_thread.stop?.should == true + ThreadSpecs.status_of_killed_thread.should.stop? end it "describes a thread with an uncaught exception" do - ThreadSpecs.status_of_thread_with_uncaught_exception.stop?.should == true + ThreadSpecs.status_of_thread_with_uncaught_exception.should.stop? end it "describes a dying running thread" do - ThreadSpecs.status_of_dying_running_thread.stop?.should == false + ThreadSpecs.status_of_dying_running_thread.should_not.stop? end it "describes a dying sleeping thread" do - ThreadSpecs.status_of_dying_sleeping_thread.stop?.should == true + ThreadSpecs.status_of_dying_sleeping_thread.should.stop? end it "describes a dying thread after sleep" do - ThreadSpecs.status_of_dying_thread_after_sleep.stop?.should == false + ThreadSpecs.status_of_dying_thread_after_sleep.should_not.stop? end end diff --git a/spec/ruby/core/time/_dump_spec.rb b/spec/ruby/core/time/_dump_spec.rb index 6941a1531f..4dc1c43cd2 100644 --- a/spec/ruby/core/time/_dump_spec.rb +++ b/spec/ruby/core/time/_dump_spec.rb @@ -15,11 +15,11 @@ describe "Time#_dump" do # http://redmine.ruby-lang.org/issues/show/627 it "preserves the GMT flag" do - @t.gmt?.should == true + @t.should.gmt? dump = @t.send(:_dump).unpack("VV").first ((dump >> 30) & 0x1).should == 1 - @local.gmt?.should == false + @local.should_not.gmt? dump = @local.send(:_dump).unpack("VV").first ((dump >> 30) & 0x1).should == 0 end diff --git a/spec/ruby/core/time/at_spec.rb b/spec/ruby/core/time/at_spec.rb index 28a3d7b34c..6f4d83f9ad 100644 --- a/spec/ruby/core/time/at_spec.rb +++ b/spec/ruby/core/time/at_spec.rb @@ -14,7 +14,7 @@ describe "Time.at" do end it "returns a non-UTC Time" do - Time.at(1184027924).utc?.should == false + Time.at(1184027924).should_not.utc? end it "returns a subclass instance on a Time subclass" do @@ -54,12 +54,12 @@ describe "Time.at" do it "returns a UTC time if the argument is UTC" do t = Time.now.getgm - Time.at(t).utc?.should == true + Time.at(t).should.utc? end it "returns a non-UTC time if the argument is non-UTC" do t = Time.now - Time.at(t).utc?.should == false + Time.at(t).should_not.utc? end it "returns a subclass instance" do diff --git a/spec/ruby/core/time/dup_spec.rb b/spec/ruby/core/time/dup_spec.rb index ee2ff7dbba..5d6621beaa 100644 --- a/spec/ruby/core/time/dup_spec.rb +++ b/spec/ruby/core/time/dup_spec.rb @@ -7,7 +7,7 @@ describe "Time#dup" do end it "copies the gmt state flag" do - Time.now.gmtime.dup.gmt?.should == true + Time.now.gmtime.dup.should.gmt? end it "returns an independent Time object" do @@ -15,7 +15,7 @@ describe "Time#dup" do t2 = t.dup t.gmtime - t2.gmt?.should == false + t2.should_not.gmt? end it "returns a subclass instance" do diff --git a/spec/ruby/core/time/friday_spec.rb b/spec/ruby/core/time/friday_spec.rb index 27f9e1dbe5..8bee7f7558 100644 --- a/spec/ruby/core/time/friday_spec.rb +++ b/spec/ruby/core/time/friday_spec.rb @@ -2,10 +2,10 @@ require_relative '../../spec_helper' describe "Time#friday?" do it "returns true if time represents Friday" do - Time.local(2000, 1, 7).friday?.should == true + Time.local(2000, 1, 7).should.friday? end it "returns false if time doesn't represent Friday" do - Time.local(2000, 1, 1).friday?.should == false + Time.local(2000, 1, 1).should_not.friday? end end diff --git a/spec/ruby/core/time/gmt_spec.rb b/spec/ruby/core/time/gmt_spec.rb index 7e85749d5b..840f59e0e8 100644 --- a/spec/ruby/core/time/gmt_spec.rb +++ b/spec/ruby/core/time/gmt_spec.rb @@ -2,7 +2,7 @@ require_relative '../../spec_helper' describe "Time#gmt?" do it "returns true if time represents a time in UTC (GMT)" do - Time.now.gmt?.should == false - Time.now.gmtime.gmt?.should == true + Time.now.should_not.gmt? + Time.now.gmtime.should.gmt? end end diff --git a/spec/ruby/core/time/minus_spec.rb b/spec/ruby/core/time/minus_spec.rb index 65613d11e9..995dac8462 100644 --- a/spec/ruby/core/time/minus_spec.rb +++ b/spec/ruby/core/time/minus_spec.rb @@ -79,11 +79,11 @@ describe "Time#-" do end it "returns a UTC time if self is UTC" do - (Time.utc(2012) - 10).utc?.should == true + (Time.utc(2012) - 10).should.utc? end it "returns a non-UTC time if self is non-UTC" do - (Time.local(2012) - 10).utc?.should == false + (Time.local(2012) - 10).should_not.utc? end it "returns a time with the same fixed offset as self" do diff --git a/spec/ruby/core/time/monday_spec.rb b/spec/ruby/core/time/monday_spec.rb index c5c43a5c3e..47ecaeb1db 100644 --- a/spec/ruby/core/time/monday_spec.rb +++ b/spec/ruby/core/time/monday_spec.rb @@ -2,10 +2,10 @@ require_relative '../../spec_helper' describe "Time#monday?" do it "returns true if time represents Monday" do - Time.local(2000, 1, 3).monday?.should == true + Time.local(2000, 1, 3).should.monday? end it "returns false if time doesn't represent Monday" do - Time.local(2000, 1, 1).monday?.should == false + Time.local(2000, 1, 1).should_not.monday? end end diff --git a/spec/ruby/core/time/new_spec.rb b/spec/ruby/core/time/new_spec.rb index a5cfa2a7df..3cafd46db7 100644 --- a/spec/ruby/core/time/new_spec.rb +++ b/spec/ruby/core/time/new_spec.rb @@ -15,7 +15,7 @@ end describe "Time.new with a utc_offset argument" do it "returns a non-UTC time" do - Time.new(2000, 1, 1, 0, 0, 0, 0).utc?.should == false + Time.new(2000, 1, 1, 0, 0, 0, 0).should_not.utc? end it "returns a Time with a UTC offset of the specified number of Integer seconds" do diff --git a/spec/ruby/core/time/plus_spec.rb b/spec/ruby/core/time/plus_spec.rb index 6c29baf124..c59d9a32bb 100644 --- a/spec/ruby/core/time/plus_spec.rb +++ b/spec/ruby/core/time/plus_spec.rb @@ -37,11 +37,11 @@ describe "Time#+" do end it "returns a UTC time if self is UTC" do - (Time.utc(2012) + 10).utc?.should == true + (Time.utc(2012) + 10).should.utc? end it "returns a non-UTC time if self is non-UTC" do - (Time.local(2012) + 10).utc?.should == false + (Time.local(2012) + 10).should_not.utc? end it "returns a time with the same fixed offset as self" do diff --git a/spec/ruby/core/time/saturday_spec.rb b/spec/ruby/core/time/saturday_spec.rb index 60ffea4198..0e51407366 100644 --- a/spec/ruby/core/time/saturday_spec.rb +++ b/spec/ruby/core/time/saturday_spec.rb @@ -2,10 +2,10 @@ require_relative '../../spec_helper' describe "Time#saturday?" do it "returns true if time represents Saturday" do - Time.local(2000, 1, 1).saturday?.should == true + Time.local(2000, 1, 1).should.saturday? end it "returns false if time doesn't represent Saturday" do - Time.local(2000, 1, 2).saturday?.should == false + Time.local(2000, 1, 2).should_not.saturday? end end diff --git a/spec/ruby/core/time/sunday_spec.rb b/spec/ruby/core/time/sunday_spec.rb index 2285583579..0d46421132 100644 --- a/spec/ruby/core/time/sunday_spec.rb +++ b/spec/ruby/core/time/sunday_spec.rb @@ -2,10 +2,10 @@ require_relative '../../spec_helper' describe "Time#sunday?" do it "returns true if time represents Sunday" do - Time.local(2000, 1, 2).sunday?.should == true + Time.local(2000, 1, 2).should.sunday? end it "returns false if time doesn't represent Sunday" do - Time.local(2000, 1, 1).sunday?.should == false + Time.local(2000, 1, 1).should_not.sunday? end end diff --git a/spec/ruby/core/time/thursday_spec.rb b/spec/ruby/core/time/thursday_spec.rb index c82d517519..c11e79d2fa 100644 --- a/spec/ruby/core/time/thursday_spec.rb +++ b/spec/ruby/core/time/thursday_spec.rb @@ -2,10 +2,10 @@ require_relative '../../spec_helper' describe "Time#thursday?" do it "returns true if time represents Thursday" do - Time.local(2000, 1, 6).thursday?.should == true + Time.local(2000, 1, 6).should.thursday? end it "returns false if time doesn't represent Thursday" do - Time.local(2000, 1, 1).thursday?.should == false + Time.local(2000, 1, 1).should_not.thursday? end end diff --git a/spec/ruby/core/time/tuesday_spec.rb b/spec/ruby/core/time/tuesday_spec.rb index 7abbdc92c0..0e7b9e7506 100644 --- a/spec/ruby/core/time/tuesday_spec.rb +++ b/spec/ruby/core/time/tuesday_spec.rb @@ -2,10 +2,10 @@ require_relative '../../spec_helper' describe "Time#tuesday?" do it "returns true if time represents Tuesday" do - Time.local(2000, 1, 4).tuesday?.should == true + Time.local(2000, 1, 4).should.tuesday? end it "returns false if time doesn't represent Tuesday" do - Time.local(2000, 1, 1).tuesday?.should == false + Time.local(2000, 1, 1).should_not.tuesday? end end diff --git a/spec/ruby/core/time/utc_spec.rb b/spec/ruby/core/time/utc_spec.rb index 5074c8d54d..74c17a93d1 100644 --- a/spec/ruby/core/time/utc_spec.rb +++ b/spec/ruby/core/time/utc_spec.rb @@ -5,7 +5,7 @@ require_relative 'shared/time_params' describe "Time#utc?" do it "returns true if time represents a time in UTC (GMT)" do - Time.now.utc?.should == false + Time.now.should_not.utc? end end diff --git a/spec/ruby/core/time/wednesday_spec.rb b/spec/ruby/core/time/wednesday_spec.rb index 6a52c3577b..cc686681d7 100644 --- a/spec/ruby/core/time/wednesday_spec.rb +++ b/spec/ruby/core/time/wednesday_spec.rb @@ -2,10 +2,10 @@ require_relative '../../spec_helper' describe "Time#wednesday?" do it "returns true if time represents Wednesday" do - Time.local(2000, 1, 5).wednesday?.should == true + Time.local(2000, 1, 5).should.wednesday? end it "returns false if time doesn't represent Wednesday" do - Time.local(2000, 1, 1).wednesday?.should == false + Time.local(2000, 1, 1).should_not.wednesday? end end diff --git a/spec/ruby/core/tracepoint/disable_spec.rb b/spec/ruby/core/tracepoint/disable_spec.rb index 612ca3c25a..2ab9b987f4 100644 --- a/spec/ruby/core/tracepoint/disable_spec.rb +++ b/spec/ruby/core/tracepoint/disable_spec.rb @@ -41,7 +41,7 @@ describe 'TracePoint#disable' do begin trace.disable { enabled = trace.enabled? } enabled.should == false - trace.enabled?.should == true + trace.should.enabled? ensure trace.disable end @@ -52,7 +52,7 @@ describe 'TracePoint#disable' do trace.enable begin trace.disable { 42 }.should == 42 - trace.enabled?.should == true + trace.should.enabled? ensure trace.disable end @@ -65,7 +65,7 @@ describe 'TracePoint#disable' do trace.disable do |*args| args.should == [] end - trace.enabled?.should == true + trace.should.enabled? ensure trace.disable end diff --git a/spec/ruby/core/tracepoint/enable_spec.rb b/spec/ruby/core/tracepoint/enable_spec.rb index b0fe38c559..15eb2f1616 100644 --- a/spec/ruby/core/tracepoint/enable_spec.rb +++ b/spec/ruby/core/tracepoint/enable_spec.rb @@ -65,7 +65,7 @@ describe 'TracePoint#enable' do event_name.should equal(:line) args.should == [] end - trace.enabled?.should == false + trace.should_not.enabled? end it 'enables trace object on calling with a block if it was already enabled' do @@ -92,7 +92,7 @@ describe 'TracePoint#enable' do line_event = true } called.should == true - trace.enabled?.should == false + trace.should_not.enabled? end end diff --git a/spec/ruby/core/tracepoint/enabled_spec.rb b/spec/ruby/core/tracepoint/enabled_spec.rb index 0167d32fb0..dbc3c214c5 100644 --- a/spec/ruby/core/tracepoint/enabled_spec.rb +++ b/spec/ruby/core/tracepoint/enabled_spec.rb @@ -4,11 +4,11 @@ describe 'TracePoint#enabled?' do it 'returns true when current status of the trace is enable' do trace = TracePoint.new(:line) {} trace.enable do - trace.enabled?.should == true + trace.should.enabled? end end it 'returns false when current status of the trace is disabled' do - TracePoint.new(:line) {}.enabled?.should == false + TracePoint.new(:line) {}.should_not.enabled? end end diff --git a/spec/ruby/core/tracepoint/trace_spec.rb b/spec/ruby/core/tracepoint/trace_spec.rb index ea6c85bcc5..c39721e692 100644 --- a/spec/ruby/core/tracepoint/trace_spec.rb +++ b/spec/ruby/core/tracepoint/trace_spec.rb @@ -3,7 +3,7 @@ require_relative '../../spec_helper' describe 'TracePoint.trace' do it 'activates the trace automatically' do trace = TracePoint.trace(:line) {} - trace.enabled?.should == true + trace.should.enabled? trace.disable end end diff --git a/spec/ruby/core/true/to_s_spec.rb b/spec/ruby/core/true/to_s_spec.rb index 68b0052c5d..f26cd138e2 100644 --- a/spec/ruby/core/true/to_s_spec.rb +++ b/spec/ruby/core/true/to_s_spec.rb @@ -7,7 +7,7 @@ describe "TrueClass#to_s" do ruby_version_is "2.7" do it "returns a frozen string" do - true.to_s.frozen?.should == true + true.to_s.should.frozen? end it "always returns the same string" do diff --git a/spec/ruby/language/hash_spec.rb b/spec/ruby/language/hash_spec.rb index 6f2e8e5cf0..630c9d2364 100644 --- a/spec/ruby/language/hash_spec.rb +++ b/spec/ruby/language/hash_spec.rb @@ -38,7 +38,7 @@ describe "Hash literal" do key.reverse! h["foo"].should == "bar" h.keys.first.should == "foo" - h.keys.first.frozen?.should == true + h.keys.first.should.frozen? key.should == "oof" end diff --git a/spec/ruby/language/predefined_spec.rb b/spec/ruby/language/predefined_spec.rb index b0616da19b..5ce4e77906 100644 --- a/spec/ruby/language/predefined_spec.rb +++ b/spec/ruby/language/predefined_spec.rb @@ -53,10 +53,10 @@ describe "Predefined global $~" do it "is set to nil if the last match was unsuccessful" do /foo/ =~ 'foo' - $~.nil?.should == false + $~.should_not.nil? /foo/ =~ 'bar' - $~.nil?.should == true + $~.should.nil? end it "is set at the method-scoped level rather than block-scoped" do diff --git a/spec/ruby/language/regexp/encoding_spec.rb b/spec/ruby/language/regexp/encoding_spec.rb index 2db09fdda8..8e2a294b95 100644 --- a/spec/ruby/language/regexp/encoding_spec.rb +++ b/spec/ruby/language/regexp/encoding_spec.rb @@ -121,11 +121,11 @@ describe "Regexps with encoding modifiers" do make_regexp = -> str { /#{str}/ } r = make_regexp.call("été".force_encoding(Encoding::UTF_8)) - r.fixed_encoding?.should == true + r.should.fixed_encoding? r.encoding.should == Encoding::UTF_8 r = make_regexp.call("abc".force_encoding(Encoding::UTF_8)) - r.fixed_encoding?.should == false + r.should_not.fixed_encoding? r.encoding.should == Encoding::US_ASCII end end diff --git a/spec/ruby/language/regexp_spec.rb b/spec/ruby/language/regexp_spec.rb index cd71d54338..ac3f773c49 100644 --- a/spec/ruby/language/regexp_spec.rb +++ b/spec/ruby/language/regexp_spec.rb @@ -20,7 +20,7 @@ describe "Literal Regexps" do ruby_version_is "2.8" do it "is frozen" do - /Hello/.frozen?.should == true + /Hello/.should.frozen? end end diff --git a/spec/ruby/language/variables_spec.rb b/spec/ruby/language/variables_spec.rb index 7c2c7889f1..8b67289df4 100644 --- a/spec/ruby/language/variables_spec.rb +++ b/spec/ruby/language/variables_spec.rb @@ -361,7 +361,7 @@ describe "Multiple assignment" do end res = *obj res.should == [1,2] - res.frozen?.should == false + res.should_not.frozen? end it "consumes values for an anonymous splat" do diff --git a/spec/ruby/library/bigdecimal/BigDecimal_spec.rb b/spec/ruby/library/bigdecimal/BigDecimal_spec.rb index faa8dc610c..4e839e21a3 100644 --- a/spec/ruby/library/bigdecimal/BigDecimal_spec.rb +++ b/spec/ruby/library/bigdecimal/BigDecimal_spec.rb @@ -41,7 +41,7 @@ describe "Kernel#BigDecimal" do it "ignores leading and trailing whitespace" do BigDecimal(" \t\n \r1234\t\r\n ").should == BigDecimal("1234") - BigDecimal(" \t\n \rNaN \n").nan?.should == true + BigDecimal(" \t\n \rNaN \n").should.nan? BigDecimal(" \t\n \rInfinity \n").infinite?.should == 1 BigDecimal(" \t\n \r-Infinity \n").infinite?.should == -1 end @@ -100,42 +100,42 @@ describe "Kernel#BigDecimal" do end it "accepts NaN and [+-]Infinity" do - BigDecimal("NaN").nan?.should == true + BigDecimal("NaN").should.nan? pos_inf = BigDecimal("Infinity") - pos_inf.finite?.should == false + pos_inf.should_not.finite? pos_inf.should > 0 pos_inf.should == BigDecimal("+Infinity") neg_inf = BigDecimal("-Infinity") - neg_inf.finite?.should == false + neg_inf.should_not.finite? neg_inf.should < 0 end describe "accepts NaN and [+-]Infinity as Float values" do it "works without an explicit precision" do - BigDecimal(Float::NAN).nan?.should == true + BigDecimal(Float::NAN).should.nan? pos_inf = BigDecimal(Float::INFINITY) - pos_inf.finite?.should == false + pos_inf.should_not.finite? pos_inf.should > 0 pos_inf.should == BigDecimal("+Infinity") neg_inf = BigDecimal(-Float::INFINITY) - neg_inf.finite?.should == false + neg_inf.should_not.finite? neg_inf.should < 0 end it "works with an explicit precision" do - BigDecimal(Float::NAN, Float::DIG).nan?.should == true + BigDecimal(Float::NAN, Float::DIG).should.nan? pos_inf = BigDecimal(Float::INFINITY, Float::DIG) - pos_inf.finite?.should == false + pos_inf.should_not.finite? pos_inf.should > 0 pos_inf.should == BigDecimal("+Infinity") neg_inf = BigDecimal(-Float::INFINITY, Float::DIG) - neg_inf.finite?.should == false + neg_inf.should_not.finite? neg_inf.should < 0 end end diff --git a/spec/ruby/library/bigdecimal/abs_spec.rb b/spec/ruby/library/bigdecimal/abs_spec.rb index ddd2bae9a9..95dc45a905 100644 --- a/spec/ruby/library/bigdecimal/abs_spec.rb +++ b/spec/ruby/library/bigdecimal/abs_spec.rb @@ -38,7 +38,7 @@ describe "BigDecimal#abs" do it "properly handles special values" do @infinity.abs.should == @infinity @infinity_minus.abs.should == @infinity - @nan.abs.nan?.should == true # have to do it this way, since == doesn't work on NaN + @nan.abs.should.nan? # have to do it this way, since == doesn't work on NaN @zero.abs.should == 0 @zero.abs.sign.should == BigDecimal::SIGN_POSITIVE_ZERO @zero_pos.abs.should == 0 diff --git a/spec/ruby/library/bigdecimal/add_spec.rb b/spec/ruby/library/bigdecimal/add_spec.rb index 5b874687fe..bea8b8f764 100644 --- a/spec/ruby/library/bigdecimal/add_spec.rb +++ b/spec/ruby/library/bigdecimal/add_spec.rb @@ -136,8 +136,8 @@ describe "BigDecimal#add" do end it "returns NaN if NaN is involved" do - @one.add(@nan, 10000).nan?.should == true - @nan.add(@one, 1).nan?.should == true + @one.add(@nan, 10000).should.nan? + @nan.add(@one, 1).should.nan? end it "returns Infinity or -Infinity if these are involved" do @@ -166,8 +166,8 @@ describe "BigDecimal#add" do end it "returns NaN if Infinity + (- Infinity)" do - @infinity.add(@infinity_minus, 10000).nan?.should == true - @infinity_minus.add(@infinity, 10000).nan?.should == true + @infinity.add(@infinity_minus, 10000).should.nan? + @infinity_minus.add(@infinity, 10000).should.nan? end it "raises TypeError when adds nil" do diff --git a/spec/ruby/library/bigdecimal/div_spec.rb b/spec/ruby/library/bigdecimal/div_spec.rb index 0c9eb2ddec..53ad6d0418 100644 --- a/spec/ruby/library/bigdecimal/div_spec.rb +++ b/spec/ruby/library/bigdecimal/div_spec.rb @@ -80,13 +80,13 @@ describe "BigDecimal#div" do end it "returns NaN if zero is divided by zero" do - @zero.div(@zero, 0).nan?.should == true - @zero_minus.div(@zero_plus, 0).nan?.should == true - @zero_plus.div(@zero_minus, 0).nan?.should == true + @zero.div(@zero, 0).should.nan? + @zero_minus.div(@zero_plus, 0).should.nan? + @zero_plus.div(@zero_minus, 0).should.nan? - @zero.div(@zero, 10).nan?.should == true - @zero_minus.div(@zero_plus, 10).nan?.should == true - @zero_plus.div(@zero_minus, 10).nan?.should == true + @zero.div(@zero, 10).should.nan? + @zero_minus.div(@zero_plus, 10).should.nan? + @zero_plus.div(@zero_minus, 10).should.nan? end it "raises FloatDomainError if (+|-) Infinity divided by 1 and no precision given" do @@ -102,8 +102,8 @@ describe "BigDecimal#div" do end it "returns NaN if Infinity / ((+|-) Infinity)" do - @infinity.div(@infinity_minus, 100000).nan?.should == true - @infinity_minus.div(@infinity, 1).nan?.should == true + @infinity.div(@infinity_minus, 100000).should.nan? + @infinity_minus.div(@infinity, 1).should.nan? end diff --git a/spec/ruby/library/bigdecimal/divmod_spec.rb b/spec/ruby/library/bigdecimal/divmod_spec.rb index ae8b84983a..294f01cba0 100644 --- a/spec/ruby/library/bigdecimal/divmod_spec.rb +++ b/spec/ruby/library/bigdecimal/divmod_spec.rb @@ -5,8 +5,8 @@ require 'bigdecimal' module DivmodSpecs def self.check_both_nan(array) array.length.should == 2 - array[0].nan?.should == true - array[1].nan?.should == true + array[0].should.nan? + array[1].should.nan? end def self.check_both_bigdecimal(array) array.length.should == 2 @@ -150,7 +150,7 @@ describe "BigDecimal#divmod" do array = @infinity.divmod(val) array.length.should == 2 array[0].infinite?.should == (val > 0 ? 1 : -1) - array[1].nan?.should == true + array[1].should.nan? end end diff --git a/spec/ruby/library/bigdecimal/finite_spec.rb b/spec/ruby/library/bigdecimal/finite_spec.rb index 6685d589b6..8fc06029bb 100644 --- a/spec/ruby/library/bigdecimal/finite_spec.rb +++ b/spec/ruby/library/bigdecimal/finite_spec.rb @@ -21,14 +21,14 @@ describe "BigDecimal#finite?" do end it "is false if Infinity or NaN" do - @infinity.finite?.should == false - @infinity_minus.finite?.should == false - @nan.finite?.should == false + @infinity.should_not.finite? + @infinity_minus.should_not.finite? + @nan.should_not.finite? end it "returns true for finite values" do @finite_vals.each do |val| - val.finite?.should == true + val.should.finite? end end end diff --git a/spec/ruby/library/bigdecimal/fix_spec.rb b/spec/ruby/library/bigdecimal/fix_spec.rb index 53b30cbf8b..231c9a587e 100644 --- a/spec/ruby/library/bigdecimal/fix_spec.rb +++ b/spec/ruby/library/bigdecimal/fix_spec.rb @@ -34,7 +34,7 @@ describe "BigDecimal#fix" do it "correctly handles special values" do @infinity.fix.should == @infinity @infinity_neg.fix.should == @infinity_neg - @nan.fix.nan?.should == true + @nan.fix.should.nan? end it "returns 0 if the absolute value is < 1" do diff --git a/spec/ruby/library/bigdecimal/frac_spec.rb b/spec/ruby/library/bigdecimal/frac_spec.rb index 4a023b4ff6..11ccf03c2f 100644 --- a/spec/ruby/library/bigdecimal/frac_spec.rb +++ b/spec/ruby/library/bigdecimal/frac_spec.rb @@ -42,7 +42,7 @@ describe "BigDecimal#frac" do it "correctly handles special values" do @infinity.frac.should == @infinity @infinity_neg.frac.should == @infinity_neg - @nan.frac.nan?.should == true + @nan.frac.should.nan? end end diff --git a/spec/ruby/library/bigdecimal/minus_spec.rb b/spec/ruby/library/bigdecimal/minus_spec.rb index 267a0f7eab..bd3c19584b 100644 --- a/spec/ruby/library/bigdecimal/minus_spec.rb +++ b/spec/ruby/library/bigdecimal/minus_spec.rb @@ -26,18 +26,18 @@ describe "BigDecimal#-" do end it "returns NaN if NaN is involved" do - (@one - @nan).nan?.should == true - (@nan - @one).nan?.should == true - (@nan - @nan).nan?.should == true - (@nan - @infinity).nan?.should == true - (@nan - @infinity_minus).nan?.should == true - (@infinity - @nan).nan?.should == true - (@infinity_minus - @nan).nan?.should == true + (@one - @nan).should.nan? + (@nan - @one).should.nan? + (@nan - @nan).should.nan? + (@nan - @infinity).should.nan? + (@nan - @infinity_minus).should.nan? + (@infinity - @nan).should.nan? + (@infinity_minus - @nan).should.nan? end it "returns NaN both operands are infinite with the same sign" do - (@infinity - @infinity).nan?.should == true - (@infinity_minus - @infinity_minus).nan?.should == true + (@infinity - @infinity).should.nan? + (@infinity_minus - @infinity_minus).should.nan? end it "returns Infinity or -Infinity if these are involved" do diff --git a/spec/ruby/library/bigdecimal/mode_spec.rb b/spec/ruby/library/bigdecimal/mode_spec.rb index f57028ae5d..73fa1a118e 100644 --- a/spec/ruby/library/bigdecimal/mode_spec.rb +++ b/spec/ruby/library/bigdecimal/mode_spec.rb @@ -12,7 +12,7 @@ describe "BigDecimal.mode" do end it "returns the appropriate value and continue the computation if the flag is false" do - BigDecimal("NaN").add(BigDecimal("1"),0).nan?.should == true + BigDecimal("NaN").add(BigDecimal("1"),0).should.nan? BigDecimal("0").add(BigDecimal("Infinity"),0).should == BigDecimal("Infinity") BigDecimal("1").quo(BigDecimal("0")).should == BigDecimal("Infinity") end diff --git a/spec/ruby/library/bigdecimal/nan_spec.rb b/spec/ruby/library/bigdecimal/nan_spec.rb index 705492614b..9eaf69b610 100644 --- a/spec/ruby/library/bigdecimal/nan_spec.rb +++ b/spec/ruby/library/bigdecimal/nan_spec.rb @@ -4,20 +4,20 @@ require 'bigdecimal' describe "BigDecimal#nan?" do it "returns true if self is not a number" do - BigDecimal("NaN").nan?.should == true + BigDecimal("NaN").should.nan? end it "returns false if self is not a NaN" do - BigDecimal("Infinity").nan?.should == false - BigDecimal("-Infinity").nan?.should == false - BigDecimal("0").nan?.should == false - BigDecimal("+0").nan?.should == false - BigDecimal("-0").nan?.should == false - BigDecimal("2E40001").nan?.should == false - BigDecimal("3E-20001").nan?.should == false - BigDecimal("0E-200000000").nan?.should == false - BigDecimal("0E200000000000").nan?.should == false - BigDecimal("0.000000000000000000000000").nan?.should == false + BigDecimal("Infinity").should_not.nan? + BigDecimal("-Infinity").should_not.nan? + BigDecimal("0").should_not.nan? + BigDecimal("+0").should_not.nan? + BigDecimal("-0").should_not.nan? + BigDecimal("2E40001").should_not.nan? + BigDecimal("3E-20001").should_not.nan? + BigDecimal("0E-200000000").should_not.nan? + BigDecimal("0E200000000000").should_not.nan? + BigDecimal("0.000000000000000000000000").should_not.nan? end end diff --git a/spec/ruby/library/bigdecimal/plus_spec.rb b/spec/ruby/library/bigdecimal/plus_spec.rb index cefc43aeaa..d1934841c8 100644 --- a/spec/ruby/library/bigdecimal/plus_spec.rb +++ b/spec/ruby/library/bigdecimal/plus_spec.rb @@ -30,8 +30,8 @@ describe "BigDecimal#+" do end it "returns NaN if NaN is involved" do - (@one + @nan).nan?.should == true - (@nan + @one).nan?.should == true + (@one + @nan).should.nan? + (@nan + @one).should.nan? end it "returns Infinity or -Infinity if these are involved" do @@ -41,7 +41,7 @@ describe "BigDecimal#+" do end it "returns NaN if Infinity + (- Infinity)" do - (@infinity + @infinity_minus).nan?.should == true + (@infinity + @infinity_minus).should.nan? end describe "with Object" do diff --git a/spec/ruby/library/bigdecimal/quo_spec.rb b/spec/ruby/library/bigdecimal/quo_spec.rb index a5c5651778..65a4330303 100644 --- a/spec/ruby/library/bigdecimal/quo_spec.rb +++ b/spec/ruby/library/bigdecimal/quo_spec.rb @@ -6,7 +6,7 @@ describe "BigDecimal#quo" do it_behaves_like :bigdecimal_quo, :quo, [] it "returns NaN if NaN is involved" do - BigDecimal("1").quo(BigDecimal("NaN")).nan?.should == true - BigDecimal("NaN").quo(BigDecimal("1")).nan?.should == true + BigDecimal("1").quo(BigDecimal("NaN")).should.nan? + BigDecimal("NaN").quo(BigDecimal("1")).should.nan? end end diff --git a/spec/ruby/library/bigdecimal/remainder_spec.rb b/spec/ruby/library/bigdecimal/remainder_spec.rb index 04233edece..1866f665cd 100644 --- a/spec/ruby/library/bigdecimal/remainder_spec.rb +++ b/spec/ruby/library/bigdecimal/remainder_spec.rb @@ -38,8 +38,8 @@ describe "BigDecimal#remainder" do end it "returns NaN used with zero" do - @mixed.remainder(@zero).nan?.should == true - @zero.remainder(@zero).nan?.should == true + @mixed.remainder(@zero).should.nan? + @zero.remainder(@zero).should.nan? end it "returns zero if used on zero" do @@ -47,28 +47,28 @@ describe "BigDecimal#remainder" do end it "returns NaN if NaN is involved" do - @nan.remainder(@nan).nan?.should == true - @nan.remainder(@one).nan?.should == true - @one.remainder(@nan).nan?.should == true - @infinity.remainder(@nan).nan?.should == true - @nan.remainder(@infinity).nan?.should == true + @nan.remainder(@nan).should.nan? + @nan.remainder(@one).should.nan? + @one.remainder(@nan).should.nan? + @infinity.remainder(@nan).should.nan? + @nan.remainder(@infinity).should.nan? end it "returns NaN if Infinity is involved" do - @infinity.remainder(@infinity).nan?.should == true - @infinity.remainder(@one).nan?.should == true - @infinity.remainder(@mixed).nan?.should == true - @infinity.remainder(@one_minus).nan?.should == true - @infinity.remainder(@frac_1).nan?.should == true - @one.remainder(@infinity).nan?.should == true + @infinity.remainder(@infinity).should.nan? + @infinity.remainder(@one).should.nan? + @infinity.remainder(@mixed).should.nan? + @infinity.remainder(@one_minus).should.nan? + @infinity.remainder(@frac_1).should.nan? + @one.remainder(@infinity).should.nan? - @infinity_minus.remainder(@infinity_minus).nan?.should == true - @infinity_minus.remainder(@one).nan?.should == true - @one.remainder(@infinity_minus).nan?.should == true - @frac_2.remainder(@infinity_minus).nan?.should == true + @infinity_minus.remainder(@infinity_minus).should.nan? + @infinity_minus.remainder(@one).should.nan? + @one.remainder(@infinity_minus).should.nan? + @frac_2.remainder(@infinity_minus).should.nan? - @infinity.remainder(@infinity_minus).nan?.should == true - @infinity_minus.remainder(@infinity).nan?.should == true + @infinity.remainder(@infinity_minus).should.nan? + @infinity_minus.remainder(@infinity).should.nan? end it "coerces arguments to BigDecimal if possible" do diff --git a/spec/ruby/library/bigdecimal/shared/modulo.rb b/spec/ruby/library/bigdecimal/shared/modulo.rb index 67c0ecf2fc..aa5c5a640b 100644 --- a/spec/ruby/library/bigdecimal/shared/modulo.rb +++ b/spec/ruby/library/bigdecimal/shared/modulo.rb @@ -80,25 +80,25 @@ describe :bigdecimal_modulo, shared: true do end it "returns NaN if NaN is involved" do - @nan.send(@method, @nan).nan?.should == true - @nan.send(@method, @one).nan?.should == true - @one.send(@method, @nan).nan?.should == true - @infinity.send(@method, @nan).nan?.should == true - @nan.send(@method, @infinity).nan?.should == true + @nan.send(@method, @nan).should.nan? + @nan.send(@method, @one).should.nan? + @one.send(@method, @nan).should.nan? + @infinity.send(@method, @nan).should.nan? + @nan.send(@method, @infinity).should.nan? end it "returns NaN if the dividend is Infinity" do - @infinity.send(@method, @infinity).nan?.should == true - @infinity.send(@method, @one).nan?.should == true - @infinity.send(@method, @mixed).nan?.should == true - @infinity.send(@method, @one_minus).nan?.should == true - @infinity.send(@method, @frac_1).nan?.should == true + @infinity.send(@method, @infinity).should.nan? + @infinity.send(@method, @one).should.nan? + @infinity.send(@method, @mixed).should.nan? + @infinity.send(@method, @one_minus).should.nan? + @infinity.send(@method, @frac_1).should.nan? - @infinity_minus.send(@method, @infinity_minus).nan?.should == true - @infinity_minus.send(@method, @one).nan?.should == true + @infinity_minus.send(@method, @infinity_minus).should.nan? + @infinity_minus.send(@method, @one).should.nan? - @infinity.send(@method, @infinity_minus).nan?.should == true - @infinity_minus.send(@method, @infinity).nan?.should == true + @infinity.send(@method, @infinity_minus).should.nan? + @infinity_minus.send(@method, @infinity).should.nan? end it "returns the dividend if the divisor is Infinity" do diff --git a/spec/ruby/library/bigdecimal/shared/mult.rb b/spec/ruby/library/bigdecimal/shared/mult.rb index b94c9385de..c613df04c4 100644 --- a/spec/ruby/library/bigdecimal/shared/mult.rb +++ b/spec/ruby/library/bigdecimal/shared/mult.rb @@ -51,8 +51,8 @@ describe :bigdecimal_mult, shared: true do values = @regular_vals + @zeroes values.each do |val| - @nan.send(@method, val, *@object).nan?.should == true - val.send(@method, @nan, *@object).nan?.should == true + @nan.send(@method, val, *@object).should.nan? + val.send(@method, @nan, *@object).should.nan? end end @@ -62,9 +62,9 @@ describe :bigdecimal_mult, shared: true do values.each do |val| @zeroes.each do |zero| zero.send(@method, val, *@object).should == 0 - zero.send(@method, val, *@object).zero?.should == true + zero.send(@method, val, *@object).should.zero? val.send(@method, zero, *@object).should == 0 - val.send(@method, zero, *@object).zero?.should == true + val.send(@method, zero, *@object).should.zero? end end end @@ -75,8 +75,8 @@ describe :bigdecimal_mult, shared: true do values.each do |val| infs.each do |inf| - inf.send(@method, val, *@object).finite?.should == false - val.send(@method, inf, *@object).finite?.should == false + inf.send(@method, val, *@object).should_not.finite? + val.send(@method, inf, *@object).should_not.finite? end end @@ -89,9 +89,9 @@ describe :bigdecimal_mult, shared: true do end it "returns NaN if the result is undefined" do - @zero.send(@method, @infinity, *@object).nan?.should == true - @zero.send(@method, @infinity_minus, *@object).nan?.should == true - @infinity.send(@method, @zero, *@object).nan?.should == true - @infinity_minus.send(@method, @zero, *@object).nan?.should == true + @zero.send(@method, @infinity, *@object).should.nan? + @zero.send(@method, @infinity_minus, *@object).should.nan? + @infinity.send(@method, @zero, *@object).should.nan? + @infinity_minus.send(@method, @zero, *@object).should.nan? end end diff --git a/spec/ruby/library/bigdecimal/shared/power.rb b/spec/ruby/library/bigdecimal/shared/power.rb index a4848fb2e2..568a08589b 100644 --- a/spec/ruby/library/bigdecimal/shared/power.rb +++ b/spec/ruby/library/bigdecimal/shared/power.rb @@ -53,8 +53,8 @@ describe :bigdecimal_power, shared: true do end it "returns NaN if self is NaN" do - BigDecimal("NaN").send(@method, -5).nan?.should == true - BigDecimal("NaN").send(@method, 5).nan?.should == true + BigDecimal("NaN").send(@method, -5).should.nan? + BigDecimal("NaN").send(@method, 5).should.nan? end it "returns 0.0 if self is infinite and argument is negative" do diff --git a/spec/ruby/library/bigdecimal/shared/quo.rb b/spec/ruby/library/bigdecimal/shared/quo.rb index 4d6d64b787..46e6d62bf4 100644 --- a/spec/ruby/library/bigdecimal/shared/quo.rb +++ b/spec/ruby/library/bigdecimal/shared/quo.rb @@ -49,8 +49,8 @@ describe :bigdecimal_quo, shared: true do end it "returns NaN if Infinity / ((+|-) Infinity)" do - @infinity.send(@method, @infinity_minus, *@object).nan?.should == true - @infinity_minus.send(@method, @infinity, *@object).nan?.should == true + @infinity.send(@method, @infinity_minus, *@object).should.nan? + @infinity_minus.send(@method, @infinity, *@object).should.nan? end it "returns (+|-) Infinity if divided by zero" do @@ -60,8 +60,8 @@ describe :bigdecimal_quo, shared: true do end it "returns NaN if zero is divided by zero" do - @zero.send(@method, @zero, *@object).nan?.should == true - @zero_minus.send(@method, @zero_plus, *@object).nan?.should == true - @zero_plus.send(@method, @zero_minus, *@object).nan?.should == true + @zero.send(@method, @zero, *@object).should.nan? + @zero_minus.send(@method, @zero_plus, *@object).should.nan? + @zero_plus.send(@method, @zero_minus, *@object).should.nan? end end diff --git a/spec/ruby/library/bigdecimal/sub_spec.rb b/spec/ruby/library/bigdecimal/sub_spec.rb index 29ec851193..bddfec2186 100644 --- a/spec/ruby/library/bigdecimal/sub_spec.rb +++ b/spec/ruby/library/bigdecimal/sub_spec.rb @@ -50,13 +50,13 @@ describe "BigDecimal#sub" do end it "returns NaN if NaN is involved" do - @one.sub(@nan, 1).nan?.should == true - @nan.sub(@one, 1).nan?.should == true + @one.sub(@nan, 1).should.nan? + @nan.sub(@one, 1).should.nan? end it "returns NaN if both values are infinite with the same signs" do - @infinity.sub(@infinity, 1).nan?.should == true - @infinity_minus.sub(@infinity_minus, 1).nan?.should == true + @infinity.sub(@infinity, 1).should.nan? + @infinity_minus.sub(@infinity_minus, 1).should.nan? end it "returns Infinity or -Infinity if these are involved" do diff --git a/spec/ruby/library/bigdecimal/to_f_spec.rb b/spec/ruby/library/bigdecimal/to_f_spec.rb index 1cc25d5c40..84d4d49de2 100644 --- a/spec/ruby/library/bigdecimal/to_f_spec.rb +++ b/spec/ruby/library/bigdecimal/to_f_spec.rb @@ -41,7 +41,7 @@ describe "BigDecimal#to_f" do @zero.to_f.should == 0 @zero.to_f.to_s.should == "0.0" - @nan.to_f.nan?.should == true + @nan.to_f.should.nan? @infinity.to_f.infinite?.should == 1 @infinity_minus.to_f.infinite?.should == -1 diff --git a/spec/ruby/library/bigdecimal/truncate_spec.rb b/spec/ruby/library/bigdecimal/truncate_spec.rb index d3a15f62c7..4ad9eb92d1 100644 --- a/spec/ruby/library/bigdecimal/truncate_spec.rb +++ b/spec/ruby/library/bigdecimal/truncate_spec.rb @@ -58,9 +58,9 @@ describe "BigDecimal#truncate" do end it "returns NaN if self is NaN" do - @nan.truncate(-1).nan?.should == true - @nan.truncate(+1).nan?.should == true - @nan.truncate(0).nan?.should == true + @nan.truncate(-1).should.nan? + @nan.truncate(+1).should.nan? + @nan.truncate(0).should.nan? end it "returns Infinity if self is infinite" do diff --git a/spec/ruby/library/bigdecimal/uminus_spec.rb b/spec/ruby/library/bigdecimal/uminus_spec.rb index 5e2a786c4c..c780cdfac5 100644 --- a/spec/ruby/library/bigdecimal/uminus_spec.rb +++ b/spec/ruby/library/bigdecimal/uminus_spec.rb @@ -53,6 +53,6 @@ describe "BigDecimal#-@" do @zero_neg.send(:-@).should == @zero @zero_neg.send(:-@).sign.should == 1 - @nan.send(:-@).nan?.should == true + @nan.send(:-@).should.nan? end end diff --git a/spec/ruby/library/bigdecimal/zero_spec.rb b/spec/ruby/library/bigdecimal/zero_spec.rb index c5d3acb8c3..2563210939 100644 --- a/spec/ruby/library/bigdecimal/zero_spec.rb +++ b/spec/ruby/library/bigdecimal/zero_spec.rb @@ -6,22 +6,22 @@ describe "BigDecimal#zero?" do it "returns true if self does equal zero" do really_small_zero = BigDecimal("0E-200000000") really_big_zero = BigDecimal("0E200000000000") - really_small_zero.zero?.should == true - really_big_zero.zero?.should == true - BigDecimal("0.000000000000000000000000").zero?.should == true - BigDecimal("0").zero?.should == true - BigDecimal("0E0").zero?.should == true - BigDecimal("+0").zero?.should == true - BigDecimal("-0").zero?.should == true + really_small_zero.should.zero? + really_big_zero.should.zero? + BigDecimal("0.000000000000000000000000").should.zero? + BigDecimal("0").should.zero? + BigDecimal("0E0").should.zero? + BigDecimal("+0").should.zero? + BigDecimal("-0").should.zero? end it "returns false otherwise" do - BigDecimal("0000000001").zero?.should == false - BigDecimal("2E40001").zero?.should == false - BigDecimal("3E-20001").zero?.should == false - BigDecimal("Infinity").zero?.should == false - BigDecimal("-Infinity").zero?.should == false - BigDecimal("NaN").zero?.should == false + BigDecimal("0000000001").should_not.zero? + BigDecimal("2E40001").should_not.zero? + BigDecimal("3E-20001").should_not.zero? + BigDecimal("Infinity").should_not.zero? + BigDecimal("-Infinity").should_not.zero? + BigDecimal("NaN").should_not.zero? end end diff --git a/spec/ruby/library/conditionvariable/signal_spec.rb b/spec/ruby/library/conditionvariable/signal_spec.rb index 11e4909501..86383073f1 100644 --- a/spec/ruby/library/conditionvariable/signal_spec.rb +++ b/spec/ruby/library/conditionvariable/signal_spec.rb @@ -72,6 +72,6 @@ describe "ConditionVariable#signal" do # Check that both threads terminated without exception t1.join t2.join - m.locked?.should == false + m.should_not.locked? end end diff --git a/spec/ruby/library/csv/liberal_parsing_spec.rb b/spec/ruby/library/csv/liberal_parsing_spec.rb index 2929d6e2aa..9878658027 100644 --- a/spec/ruby/library/csv/liberal_parsing_spec.rb +++ b/spec/ruby/library/csv/liberal_parsing_spec.rb @@ -4,16 +4,16 @@ require 'csv' describe "CSV#liberal_parsing?" do it "returns true if illegal input is handled" do csv = CSV.new("", liberal_parsing: true) - csv.liberal_parsing?.should == true + csv.should.liberal_parsing? end it "returns false if illegal input is not handled" do csv = CSV.new("", liberal_parsing: false) - csv.liberal_parsing?.should == false + csv.should_not.liberal_parsing? end it "returns false by default" do csv = CSV.new("") - csv.liberal_parsing?.should == false + csv.should_not.liberal_parsing? end end diff --git a/spec/ruby/library/date/gregorian_spec.rb b/spec/ruby/library/date/gregorian_spec.rb index 8b7033fe75..ea7ece2ade 100644 --- a/spec/ruby/library/date/gregorian_spec.rb +++ b/spec/ruby/library/date/gregorian_spec.rb @@ -9,7 +9,7 @@ describe "Date#gregorian?" do end it "marks a day after the calendar reform as Julian" do - Date.civil(2007, 2, 27).gregorian?.should == true + Date.civil(2007, 2, 27).should.gregorian? Date.civil(1607, 2, 27, Date.civil(1582, 1, 1).jd).gregorian?.should be_true end diff --git a/spec/ruby/library/date/infinity_spec.rb b/spec/ruby/library/date/infinity_spec.rb index 81d67ae249..721fd76066 100644 --- a/spec/ruby/library/date/infinity_spec.rb +++ b/spec/ruby/library/date/infinity_spec.rb @@ -5,16 +5,16 @@ describe "Date::Infinity" do it "should be able to check whether Infinity is zero" do i = Date::Infinity.new - i.zero?.should == false + i.should_not.zero? end it "should be able to check whether Infinity is finite" do i1 = Date::Infinity.new - i1.finite?.should == false + i1.should_not.finite? i2 = Date::Infinity.new(-1) - i2.finite?.should == false + i2.should_not.finite? i3 = Date::Infinity.new(0) - i3.finite?.should == false + i3.should_not.finite? end it "should be able to check whether Infinity is infinite" do @@ -28,11 +28,11 @@ describe "Date::Infinity" do it "should be able to check whether Infinity is not a number" do i1 = Date::Infinity.new - i1.nan?.should == false + i1.should_not.nan? i2 = Date::Infinity.new(-1) - i2.nan?.should == false + i2.should_not.nan? i3 = Date::Infinity.new(0) - i3.nan?.should == true + i3.should.nan? end it "should be able to compare Infinity objects" do diff --git a/spec/ruby/library/date/julian_spec.rb b/spec/ruby/library/date/julian_spec.rb index 637a4739e5..db2629d1e7 100644 --- a/spec/ruby/library/date/julian_spec.rb +++ b/spec/ruby/library/date/julian_spec.rb @@ -4,12 +4,12 @@ require_relative '../../spec_helper' describe "Date#julian?" do it "marks a day before the calendar reform as Julian" do - Date.civil(1007, 2, 27).julian?.should == true + Date.civil(1007, 2, 27).should.julian? Date.civil(1907, 2, 27, Date.civil(1930, 1, 1).jd).julian?.should be_true end it "marks a day after the calendar reform as Julian" do - Date.civil(2007, 2, 27).julian?.should == false + Date.civil(2007, 2, 27).should_not.julian? Date.civil(1607, 2, 27, Date.civil(1582, 1, 1).jd).julian?.should be_false end diff --git a/spec/ruby/library/date/shared/civil.rb b/spec/ruby/library/date/shared/civil.rb index 4c8ba23622..bbed4a8866 100644 --- a/spec/ruby/library/date/shared/civil.rb +++ b/spec/ruby/library/date/shared/civil.rb @@ -5,7 +5,7 @@ describe :date_civil, shared: true do d.year.should == -4712 d.month.should == 1 d.day.should == 1 - d.julian?.should == true + d.should.julian? d.jd.should == 0 end @@ -14,7 +14,7 @@ describe :date_civil, shared: true do d.year.should == 2000 d.month.should == 3 d.day.should == 5 - d.julian?.should == false + d.should_not.julian? d.jd.should == 2451609 # Should also work with years far in the past and future @@ -23,14 +23,14 @@ describe :date_civil, shared: true do d.year.should == -9000 d.month.should == 7 d.day.should == 5 - d.julian?.should == true + d.should.julian? d.jd.should == -1566006 d = Date.send(@method, 9000, 10, 14) d.year.should == 9000 d.month.should == 10 d.day.should == 14 - d.julian?.should == false + d.should_not.julian? d.jd.should == 5008529 end diff --git a/spec/ruby/library/getoptlong/terminated_spec.rb b/spec/ruby/library/getoptlong/terminated_spec.rb index 01a8feddea..6108a7f6e9 100644 --- a/spec/ruby/library/getoptlong/terminated_spec.rb +++ b/spec/ruby/library/getoptlong/terminated_spec.rb @@ -5,13 +5,13 @@ describe "GetoptLong#terminated?" do it "returns true if option processing has terminated" do argv [ "--size", "10k" ] do opts = GetoptLong.new(["--size", GetoptLong::REQUIRED_ARGUMENT]) - opts.terminated?.should == false + opts.should_not.terminated? opts.get.should == ["--size", "10k"] - opts.terminated?.should == false + opts.should_not.terminated? opts.get.should == nil - opts.terminated?.should == true + opts.should.terminated? end end end diff --git a/spec/ruby/library/ipaddr/ipv4_conversion_spec.rb b/spec/ruby/library/ipaddr/ipv4_conversion_spec.rb index 9d45055d76..1128c16dd2 100644 --- a/spec/ruby/library/ipaddr/ipv4_conversion_spec.rb +++ b/spec/ruby/library/ipaddr/ipv4_conversion_spec.rb @@ -8,11 +8,11 @@ describe "IPAddr#ipv4_compat" do a.to_s.should == "::192.168.1.2" a.to_string.should == "0000:0000:0000:0000:0000:0000:c0a8:0102" a.family.should == Socket::AF_INET6 - a.ipv4_compat?.should == true + a.should.ipv4_compat? b = a.native b.to_s.should == "192.168.1.2" b.family.should == Socket::AF_INET - b.ipv4_compat?.should == false + b.should_not.ipv4_compat? a = IPAddr.new("192.168.1.2") b = a.ipv4_compat @@ -29,11 +29,11 @@ describe "IPAddr#ipv4_mapped" do a.to_s.should == "::ffff:192.168.1.2" a.to_string.should == "0000:0000:0000:0000:0000:ffff:c0a8:0102" a.family.should == Socket::AF_INET6 - a.ipv4_mapped?.should == true + a.should.ipv4_mapped? b = a.native b.to_s.should == "192.168.1.2" b.family.should == Socket::AF_INET - b.ipv4_mapped?.should == false + b.should_not.ipv4_mapped? a = IPAddr.new("192.168.1.2") b = a.ipv4_mapped diff --git a/spec/ruby/library/ipaddr/new_spec.rb b/spec/ruby/library/ipaddr/new_spec.rb index c8c8bc80b3..3148d6e39c 100644 --- a/spec/ruby/library/ipaddr/new_spec.rb +++ b/spec/ruby/library/ipaddr/new_spec.rb @@ -27,8 +27,8 @@ describe "IPAddr#new" do a.to_s.should == "3ffe:505:2::" a.to_string.should == "3ffe:0505:0002:0000:0000:0000:0000:0000" a.family.should == Socket::AF_INET6 - a.ipv4?.should == false - a.ipv6?.should == true + a.should_not.ipv4? + a.should.ipv6? a.inspect.should == "#" end @@ -51,8 +51,8 @@ describe "IPAddr#new" do a.to_s.should == "192.168.1.2" a.to_string.should == "192.168.1.2" a.family.should == Socket::AF_INET - a.ipv4?.should == true - a.ipv6?.should == false + a.should.ipv4? + a.should_not.ipv6? end it "initializes IPAddr ipv4 address with / subnet notation" do diff --git a/spec/ruby/library/logger/logger/debug_spec.rb b/spec/ruby/library/logger/logger/debug_spec.rb index d92c339232..9375ab0cc6 100644 --- a/spec/ruby/library/logger/logger/debug_spec.rb +++ b/spec/ruby/library/logger/logger/debug_spec.rb @@ -16,12 +16,12 @@ describe "Logger#debug?" do it "returns true if severity level allows debug messages" do @logger.level = Logger::DEBUG - @logger.debug?.should == true + @logger.should.debug? end it "returns false if severity level does not allow debug messages" do @logger.level = Logger::WARN - @logger.debug?.should == false + @logger.should_not.debug? end end diff --git a/spec/ruby/library/logger/logger/error_spec.rb b/spec/ruby/library/logger/logger/error_spec.rb index d5d0bd2d2f..42f1dbd883 100644 --- a/spec/ruby/library/logger/logger/error_spec.rb +++ b/spec/ruby/library/logger/logger/error_spec.rb @@ -16,12 +16,12 @@ describe "Logger#error?" do it "returns true if severity level allows printing errors" do @logger.level = Logger::INFO - @logger.error?.should == true + @logger.should.error? end it "returns false if severity level does not allow errors" do @logger.level = Logger::FATAL - @logger.error?.should == false + @logger.should_not.error? end end diff --git a/spec/ruby/library/logger/logger/fatal_spec.rb b/spec/ruby/library/logger/logger/fatal_spec.rb index 42d4341319..f12fa3a89f 100644 --- a/spec/ruby/library/logger/logger/fatal_spec.rb +++ b/spec/ruby/library/logger/logger/fatal_spec.rb @@ -16,12 +16,12 @@ describe "Logger#fatal?" do it "returns true if severity level allows fatal messages" do @logger.level = Logger::FATAL - @logger.fatal?.should == true + @logger.should.fatal? end it "returns false if severity level does not allow fatal messages" do @logger.level = Logger::UNKNOWN - @logger.fatal?.should == false + @logger.should_not.fatal? end end diff --git a/spec/ruby/library/logger/logger/info_spec.rb b/spec/ruby/library/logger/logger/info_spec.rb index 21eacbbb31..eb5dca48dd 100644 --- a/spec/ruby/library/logger/logger/info_spec.rb +++ b/spec/ruby/library/logger/logger/info_spec.rb @@ -16,12 +16,12 @@ describe "Logger#info?" do it "returns true if severity level allows info messages" do @logger.level = Logger::INFO - @logger.info?.should == true + @logger.should.info? end it "returns false if severity level does not allow info messages" do @logger.level = Logger::FATAL - @logger.info?.should == false + @logger.should_not.info? end end diff --git a/spec/ruby/library/logger/logger/warn_spec.rb b/spec/ruby/library/logger/logger/warn_spec.rb index 6617b2b41a..0bca34824a 100644 --- a/spec/ruby/library/logger/logger/warn_spec.rb +++ b/spec/ruby/library/logger/logger/warn_spec.rb @@ -16,12 +16,12 @@ describe "Logger#warn?" do it "returns true if severity level allows printing warn messages" do @logger.level = Logger::WARN - @logger.warn?.should == true + @logger.should.warn? end it "returns false if severity level does not allow printing warn messages" do @logger.level = Logger::FATAL - @logger.warn?.should == false + @logger.should_not.warn? end end diff --git a/spec/ruby/library/matrix/normal_spec.rb b/spec/ruby/library/matrix/normal_spec.rb index ebd73aaf40..a9e6c645fa 100644 --- a/spec/ruby/library/matrix/normal_spec.rb +++ b/spec/ruby/library/matrix/normal_spec.rb @@ -3,12 +3,12 @@ require 'matrix' describe "Matrix.normal?" do # it "returns false for non normal matrices" do - # Matrix[[0, 1], [1, 2]].normal?.should == false + # Matrix[[0, 1], [1, 2]].should_not.normal? # end it "returns true for normal matrices" do - Matrix[[1, 1, 0], [0, 1, 1], [1, 0, 1]].normal?.should == true - Matrix[[0, Complex(0, 2)], [Complex(0, -2), 0]].normal?.should == true + Matrix[[1, 1, 0], [0, 1, 1], [1, 0, 1]].should.normal? + Matrix[[0, Complex(0, 2)], [Complex(0, -2), 0]].should.normal? end it "raises an error for rectangular matrices" do diff --git a/spec/ruby/library/matrix/orthogonal_spec.rb b/spec/ruby/library/matrix/orthogonal_spec.rb index 07b098a58d..26afe89ff0 100644 --- a/spec/ruby/library/matrix/orthogonal_spec.rb +++ b/spec/ruby/library/matrix/orthogonal_spec.rb @@ -3,12 +3,12 @@ require 'matrix' describe "Matrix.orthogonal?" do it "returns false for non orthogonal matrices" do - Matrix[[0, 1], [1, 2]].orthogonal?.should == false - Matrix[[1, 1, 0], [0, 1, 1], [1, 0, 1]].orthogonal?.should == false + Matrix[[0, 1], [1, 2]].should_not.orthogonal? + Matrix[[1, 1, 0], [0, 1, 1], [1, 0, 1]].should_not.orthogonal? end it "returns true for orthogonal matrices" do - Matrix[[0, 1], [1, 0]].orthogonal?.should == true + Matrix[[0, 1], [1, 0]].should.orthogonal? end it "raises an error for rectangular matrices" do diff --git a/spec/ruby/library/matrix/unitary_spec.rb b/spec/ruby/library/matrix/unitary_spec.rb index c52f9d97d9..af4b2bb442 100644 --- a/spec/ruby/library/matrix/unitary_spec.rb +++ b/spec/ruby/library/matrix/unitary_spec.rb @@ -3,18 +3,18 @@ require 'matrix' describe "Matrix.unitary?" do it "returns false for non unitary matrices" do - Matrix[[0, 1], [1, 2]].unitary?.should == false - Matrix[[0, Complex(0, 2)], [Complex(0, 2), 0]].unitary?.should == false - Matrix[[1, 1, 0], [0, 1, 1], [1, 0, 1]].unitary?.should == false + Matrix[[0, 1], [1, 2]].should_not.unitary? + Matrix[[0, Complex(0, 2)], [Complex(0, 2), 0]].should_not.unitary? + Matrix[[1, 1, 0], [0, 1, 1], [1, 0, 1]].should_not.unitary? end it "returns true for unitary matrices" do - Matrix[[0, Complex(0, 1)], [Complex(0, 1), 0]].unitary?.should == true + Matrix[[0, Complex(0, 1)], [Complex(0, 1), 0]].should.unitary? end version_is((Matrix::const_defined?(:VERSION) ? Matrix::VERSION : "0.1.0"), "0.3.0") do it "returns true for unitary matrices with a Complex and a negative #imag" do - Matrix[[0, Complex(0, 1)], [Complex(0, -1), 0]].unitary?.should == true + Matrix[[0, Complex(0, 1)], [Complex(0, -1), 0]].should.unitary? end end diff --git a/spec/ruby/library/matrix/zero_spec.rb b/spec/ruby/library/matrix/zero_spec.rb index 643c57acba..68e8567c26 100644 --- a/spec/ruby/library/matrix/zero_spec.rb +++ b/spec/ruby/library/matrix/zero_spec.rb @@ -37,16 +37,16 @@ end describe "Matrix.zero?" do it "returns true for empty matrices" do - Matrix.empty.zero?.should == true - Matrix.empty(3,0).zero?.should == true - Matrix.empty(0,3).zero?.should == true + Matrix.empty.should.zero? + Matrix.empty(3,0).should.zero? + Matrix.empty(0,3).should.zero? end it "returns true for matrices with zero entries" do - Matrix.zero(2,3).zero?.should == true + Matrix.zero(2,3).should.zero? end it "returns false for matrices with non zero entries" do - Matrix[[1]].zero?.should == false + Matrix[[1]].should_not.zero? end end diff --git a/spec/ruby/library/net/http/httpresponse/body_permitted_spec.rb b/spec/ruby/library/net/http/httpresponse/body_permitted_spec.rb index 68a0454f79..8ade46689f 100644 --- a/spec/ruby/library/net/http/httpresponse/body_permitted_spec.rb +++ b/spec/ruby/library/net/http/httpresponse/body_permitted_spec.rb @@ -3,11 +3,11 @@ require 'net/http' describe "Net::HTTPResponse.body_permitted?" do it "returns true if this response type can have a response body" do - Net::HTTPUnknownResponse.body_permitted?.should == true - Net::HTTPInformation.body_permitted?.should == false - Net::HTTPSuccess.body_permitted?.should == true - Net::HTTPRedirection.body_permitted?.should == true - Net::HTTPClientError.body_permitted?.should == true - Net::HTTPServerError.body_permitted?.should == true + Net::HTTPUnknownResponse.should.body_permitted? + Net::HTTPInformation.should_not.body_permitted? + Net::HTTPSuccess.should.body_permitted? + Net::HTTPRedirection.should.body_permitted? + Net::HTTPClientError.should.body_permitted? + Net::HTTPServerError.should.body_permitted? end end diff --git a/spec/ruby/library/pathname/absolute_spec.rb b/spec/ruby/library/pathname/absolute_spec.rb index dce3ae72ee..109abb8ee9 100644 --- a/spec/ruby/library/pathname/absolute_spec.rb +++ b/spec/ruby/library/pathname/absolute_spec.rb @@ -4,19 +4,19 @@ require 'pathname' describe "Pathname#absolute?" do it "returns true for the root directory" do - Pathname.new('/').absolute?.should == true + Pathname.new('/').should.absolute? end it "returns true for a dir starting with a slash" do - Pathname.new('/usr/local/bin').absolute?.should == true + Pathname.new('/usr/local/bin').should.absolute? end it "returns false for a dir not starting with a slash" do - Pathname.new('fish').absolute?.should == false + Pathname.new('fish').should_not.absolute? end it "returns false for a dir not starting with a slash" do - Pathname.new('fish/dog/cow').absolute?.should == false + Pathname.new('fish/dog/cow').should_not.absolute? end end diff --git a/spec/ruby/library/pathname/new_spec.rb b/spec/ruby/library/pathname/new_spec.rb index dcb770149f..760fd8638f 100644 --- a/spec/ruby/library/pathname/new_spec.rb +++ b/spec/ruby/library/pathname/new_spec.rb @@ -13,7 +13,7 @@ describe "Pathname.new" do ruby_version_is ''...'2.7' do it "is tainted if path is tainted" do path = '/usr/local/bin'.taint - Pathname.new(path).tainted?.should == true + Pathname.new(path).should.tainted? end end diff --git a/spec/ruby/library/pathname/relative_spec.rb b/spec/ruby/library/pathname/relative_spec.rb index 1a08891e6c..0fab9a7b9f 100644 --- a/spec/ruby/library/pathname/relative_spec.rb +++ b/spec/ruby/library/pathname/relative_spec.rb @@ -4,19 +4,19 @@ require 'pathname' describe "Pathname#relative?" do it "returns false for the root directory" do - Pathname.new('/').relative?.should == false + Pathname.new('/').should_not.relative? end it "returns false for a dir starting with a slash" do - Pathname.new('/usr/local/bin').relative?.should == false + Pathname.new('/usr/local/bin').should_not.relative? end it "returns true for a dir not starting with a slash" do - Pathname.new('fish').relative?.should == true + Pathname.new('fish').should.relative? end it "returns true for a dir not starting with a slash" do - Pathname.new('fish/dog/cow').relative?.should == true + Pathname.new('fish/dog/cow').should.relative? end end diff --git a/spec/ruby/library/pathname/root_spec.rb b/spec/ruby/library/pathname/root_spec.rb index 5fec0ee956..cd2be24516 100644 --- a/spec/ruby/library/pathname/root_spec.rb +++ b/spec/ruby/library/pathname/root_spec.rb @@ -4,23 +4,23 @@ require 'pathname' describe "Pathname#root?" do it "returns true for root directories" do - Pathname.new('/').root?.should == true + Pathname.new('/').should.root? end it "returns false for empty string" do - Pathname.new('').root?.should == false + Pathname.new('').should_not.root? end it "returns false for a top level directory" do - Pathname.new('/usr').root?.should == false + Pathname.new('/usr').should_not.root? end it "returns false for a top level with .. appended directory" do - Pathname.new('/usr/..').root?.should == false + Pathname.new('/usr/..').should_not.root? end it "returns false for a directory below top level" do - Pathname.new('/usr/local/bin/').root?.should == false + Pathname.new('/usr/local/bin/').should_not.root? end end diff --git a/spec/ruby/library/rexml/element/cdatas_spec.rb b/spec/ruby/library/rexml/element/cdatas_spec.rb index 4cc592aae3..ecbca94f62 100644 --- a/spec/ruby/library/rexml/element/cdatas_spec.rb +++ b/spec/ruby/library/rexml/element/cdatas_spec.rb @@ -17,7 +17,7 @@ ruby_version_is ''...'2.8' do end it "freezes the returned array" do - @e.cdatas.frozen?.should == true + @e.cdatas.should.frozen? end it "returns an empty array if element has no cdata" do diff --git a/spec/ruby/library/rexml/element/comments_spec.rb b/spec/ruby/library/rexml/element/comments_spec.rb index 59a0b3e4fb..26043366d3 100644 --- a/spec/ruby/library/rexml/element/comments_spec.rb +++ b/spec/ruby/library/rexml/element/comments_spec.rb @@ -17,7 +17,7 @@ ruby_version_is ''...'2.8' do end it "returns a frozen object" do - @e.comments.frozen?.should == true + @e.comments.should.frozen? end end end diff --git a/spec/ruby/library/rexml/node/parent_spec.rb b/spec/ruby/library/rexml/node/parent_spec.rb index 693ee9d5c2..0a31abaf0f 100644 --- a/spec/ruby/library/rexml/node/parent_spec.rb +++ b/spec/ruby/library/rexml/node/parent_spec.rb @@ -6,18 +6,18 @@ ruby_version_is ''...'2.8' do describe "REXML::Node#parent?" do it "returns true for Elements" do e = REXML::Element.new("foo") - e.parent?.should == true + e.should.parent? end it "returns true for Documents" do e = REXML::Document.new - e.parent?.should == true + e.should.parent? end # This includes attributes, CDatas and declarations. it "returns false for Texts" do e = REXML::Text.new("foo") - e.parent?.should == false + e.should_not.parent? end end end diff --git a/spec/ruby/library/rexml/text/empty_spec.rb b/spec/ruby/library/rexml/text/empty_spec.rb index 392b536a4c..18f31580ad 100644 --- a/spec/ruby/library/rexml/text/empty_spec.rb +++ b/spec/ruby/library/rexml/text/empty_spec.rb @@ -5,11 +5,11 @@ ruby_version_is ''...'2.8' do describe "REXML::Text#empty?" do it "returns true if the text is empty" do - REXML::Text.new("").empty?.should == true + REXML::Text.new("").should.empty? end it "returns false if the text is not empty" do - REXML::Text.new("some_text").empty?.should == false + REXML::Text.new("some_text").should_not.empty? end end end diff --git a/spec/ruby/library/set/compare_by_identity_spec.rb b/spec/ruby/library/set/compare_by_identity_spec.rb index 28fe91309f..9ed1602189 100644 --- a/spec/ruby/library/set/compare_by_identity_spec.rb +++ b/spec/ruby/library/set/compare_by_identity_spec.rb @@ -42,7 +42,7 @@ describe "Set#compare_by_identity" do set = Set.new.compare_by_identity set << :foo set.compare_by_identity.should equal(set) - set.compare_by_identity?.should == true + set.should.compare_by_identity? set.to_a.should == [:foo] end @@ -124,20 +124,20 @@ end describe "Set#compare_by_identity?" do it "returns false by default" do - Set.new.compare_by_identity?.should == false + Set.new.should_not.compare_by_identity? end it "returns true once #compare_by_identity has been invoked on self" do set = Set.new set.compare_by_identity - set.compare_by_identity?.should == true + set.should.compare_by_identity? end it "returns true when called multiple times on the same set" do set = Set.new set.compare_by_identity - set.compare_by_identity?.should == true - set.compare_by_identity?.should == true - set.compare_by_identity?.should == true + set.should.compare_by_identity? + set.should.compare_by_identity? + set.should.compare_by_identity? end end diff --git a/spec/ruby/library/socket/addrinfo/ipv4_loopback_spec.rb b/spec/ruby/library/socket/addrinfo/ipv4_loopback_spec.rb index f5bab711db..10ad084fc9 100644 --- a/spec/ruby/library/socket/addrinfo/ipv4_loopback_spec.rb +++ b/spec/ruby/library/socket/addrinfo/ipv4_loopback_spec.rb @@ -3,10 +3,10 @@ require_relative '../spec_helper' describe "Addrinfo#ipv4_loopback?" do describe "for an ipv4 socket" do it "returns true for the loopback address" do - Addrinfo.ip('127.0.0.1').ipv4_loopback?.should == true - Addrinfo.ip('127.0.0.2').ipv4_loopback?.should == true - Addrinfo.ip('127.255.0.1').ipv4_loopback?.should == true - Addrinfo.ip('127.255.255.255').ipv4_loopback?.should == true + Addrinfo.ip('127.0.0.1').should.ipv4_loopback? + Addrinfo.ip('127.0.0.2').should.ipv4_loopback? + Addrinfo.ip('127.255.0.1').should.ipv4_loopback? + Addrinfo.ip('127.255.255.255').should.ipv4_loopback? end it "returns false for another address" do diff --git a/spec/ruby/library/socket/addrinfo/ipv4_multicast_spec.rb b/spec/ruby/library/socket/addrinfo/ipv4_multicast_spec.rb index bdd14c1b00..f7fead8640 100644 --- a/spec/ruby/library/socket/addrinfo/ipv4_multicast_spec.rb +++ b/spec/ruby/library/socket/addrinfo/ipv4_multicast_spec.rb @@ -2,17 +2,17 @@ require_relative '../spec_helper' describe "Addrinfo#ipv4_multicast?" do it 'returns true for a multicast address' do - Addrinfo.ip('224.0.0.0').ipv4_multicast?.should == true - Addrinfo.ip('224.0.0.9').ipv4_multicast?.should == true - Addrinfo.ip('239.255.255.250').ipv4_multicast?.should == true + Addrinfo.ip('224.0.0.0').should.ipv4_multicast? + Addrinfo.ip('224.0.0.9').should.ipv4_multicast? + Addrinfo.ip('239.255.255.250').should.ipv4_multicast? end it 'returns false for a regular address' do - Addrinfo.ip('8.8.8.8').ipv4_multicast?.should == false + Addrinfo.ip('8.8.8.8').should_not.ipv4_multicast? end it 'returns false for an IPv6 address' do - Addrinfo.ip('::1').ipv4_multicast?.should == false + Addrinfo.ip('::1').should_not.ipv4_multicast? end with_feature :unix_socket do diff --git a/spec/ruby/library/socket/addrinfo/ipv4_private_spec.rb b/spec/ruby/library/socket/addrinfo/ipv4_private_spec.rb index 733577609e..e5a33b4953 100644 --- a/spec/ruby/library/socket/addrinfo/ipv4_private_spec.rb +++ b/spec/ruby/library/socket/addrinfo/ipv4_private_spec.rb @@ -8,14 +8,14 @@ describe "Addrinfo#ipv4_private?" do end it "returns true for a private address" do - Addrinfo.ip('10.0.0.0').ipv4_private?.should == true - Addrinfo.ip('10.0.0.5').ipv4_private?.should == true + Addrinfo.ip('10.0.0.0').should.ipv4_private? + Addrinfo.ip('10.0.0.5').should.ipv4_private? - Addrinfo.ip('172.16.0.0').ipv4_private?.should == true - Addrinfo.ip('172.16.0.5').ipv4_private?.should == true + Addrinfo.ip('172.16.0.0').should.ipv4_private? + Addrinfo.ip('172.16.0.5').should.ipv4_private? - Addrinfo.ip('192.168.0.0').ipv4_private?.should == true - Addrinfo.ip('192.168.0.5').ipv4_private?.should == true + Addrinfo.ip('192.168.0.0').should.ipv4_private? + Addrinfo.ip('192.168.0.5').should.ipv4_private? end it "returns false for a public address" do diff --git a/spec/ruby/library/socket/addrinfo/ipv6_linklocal_spec.rb b/spec/ruby/library/socket/addrinfo/ipv6_linklocal_spec.rb index 291b4d7d6b..bfef396381 100644 --- a/spec/ruby/library/socket/addrinfo/ipv6_linklocal_spec.rb +++ b/spec/ruby/library/socket/addrinfo/ipv6_linklocal_spec.rb @@ -5,19 +5,19 @@ guard -> { SocketSpecs.ipv6_available? } do describe 'Addrinfo#ipv6_linklocal?' do platform_is_not :aix do it 'returns true for a link-local address' do - Addrinfo.ip('fe80::').ipv6_linklocal?.should == true - Addrinfo.ip('fe81::').ipv6_linklocal?.should == true - Addrinfo.ip('fe8f::').ipv6_linklocal?.should == true - Addrinfo.ip('fe80::1').ipv6_linklocal?.should == true + Addrinfo.ip('fe80::').should.ipv6_linklocal? + Addrinfo.ip('fe81::').should.ipv6_linklocal? + Addrinfo.ip('fe8f::').should.ipv6_linklocal? + Addrinfo.ip('fe80::1').should.ipv6_linklocal? end end it 'returns false for a regular address' do - Addrinfo.ip('::1').ipv6_linklocal?.should == false + Addrinfo.ip('::1').should_not.ipv6_linklocal? end it 'returns false for an IPv4 address' do - Addrinfo.ip('127.0.0.1').ipv6_linklocal?.should == false + Addrinfo.ip('127.0.0.1').should_not.ipv6_linklocal? end end end diff --git a/spec/ruby/library/socket/addrinfo/ipv6_mc_global_spec.rb b/spec/ruby/library/socket/addrinfo/ipv6_mc_global_spec.rb index 9c8e4dccb4..01fa0992ba 100644 --- a/spec/ruby/library/socket/addrinfo/ipv6_mc_global_spec.rb +++ b/spec/ruby/library/socket/addrinfo/ipv6_mc_global_spec.rb @@ -2,19 +2,19 @@ require_relative '../spec_helper' describe 'Addrinfo#ipv6_mc_global?' do it 'returns true for a multi-cast address in the global scope' do - Addrinfo.ip('ff1e::').ipv6_mc_global?.should == true - Addrinfo.ip('fffe::').ipv6_mc_global?.should == true - Addrinfo.ip('ff0e::').ipv6_mc_global?.should == true - Addrinfo.ip('ff1e::1').ipv6_mc_global?.should == true + Addrinfo.ip('ff1e::').should.ipv6_mc_global? + Addrinfo.ip('fffe::').should.ipv6_mc_global? + Addrinfo.ip('ff0e::').should.ipv6_mc_global? + Addrinfo.ip('ff1e::1').should.ipv6_mc_global? end it 'returns false for a regular IPv6 address' do - Addrinfo.ip('::1').ipv6_mc_global?.should == false - Addrinfo.ip('ff1a::').ipv6_mc_global?.should == false - Addrinfo.ip('ff1f::1').ipv6_mc_global?.should == false + Addrinfo.ip('::1').should_not.ipv6_mc_global? + Addrinfo.ip('ff1a::').should_not.ipv6_mc_global? + Addrinfo.ip('ff1f::1').should_not.ipv6_mc_global? end it 'returns false for an IPv4 address' do - Addrinfo.ip('127.0.0.1').ipv6_mc_global?.should == false + Addrinfo.ip('127.0.0.1').should_not.ipv6_mc_global? end end diff --git a/spec/ruby/library/socket/addrinfo/ipv6_mc_linklocal_spec.rb b/spec/ruby/library/socket/addrinfo/ipv6_mc_linklocal_spec.rb index dd52a9ad8b..a1298919eb 100644 --- a/spec/ruby/library/socket/addrinfo/ipv6_mc_linklocal_spec.rb +++ b/spec/ruby/library/socket/addrinfo/ipv6_mc_linklocal_spec.rb @@ -2,18 +2,18 @@ require_relative '../spec_helper' describe 'Addrinfo#ipv6_mc_linklocal?' do it 'returns true for a multi-cast link-local address' do - Addrinfo.ip('ff12::').ipv6_mc_linklocal?.should == true - Addrinfo.ip('ff02::').ipv6_mc_linklocal?.should == true - Addrinfo.ip('fff2::').ipv6_mc_linklocal?.should == true - Addrinfo.ip('ff12::1').ipv6_mc_linklocal?.should == true + Addrinfo.ip('ff12::').should.ipv6_mc_linklocal? + Addrinfo.ip('ff02::').should.ipv6_mc_linklocal? + Addrinfo.ip('fff2::').should.ipv6_mc_linklocal? + Addrinfo.ip('ff12::1').should.ipv6_mc_linklocal? end it 'returns false for a regular IPv6 address' do - Addrinfo.ip('::1').ipv6_mc_linklocal?.should == false - Addrinfo.ip('fff1::').ipv6_mc_linklocal?.should == false + Addrinfo.ip('::1').should_not.ipv6_mc_linklocal? + Addrinfo.ip('fff1::').should_not.ipv6_mc_linklocal? end it 'returns false for an IPv4 address' do - Addrinfo.ip('127.0.0.1').ipv6_mc_linklocal?.should == false + Addrinfo.ip('127.0.0.1').should_not.ipv6_mc_linklocal? end end diff --git a/spec/ruby/library/socket/addrinfo/ipv6_mc_nodelocal_spec.rb b/spec/ruby/library/socket/addrinfo/ipv6_mc_nodelocal_spec.rb index b3cf5ffbab..0aee952d88 100644 --- a/spec/ruby/library/socket/addrinfo/ipv6_mc_nodelocal_spec.rb +++ b/spec/ruby/library/socket/addrinfo/ipv6_mc_nodelocal_spec.rb @@ -2,17 +2,17 @@ require_relative '../spec_helper' describe 'Addrinfo#ipv6_mc_nodelocal?' do it 'returns true for a multi-cast node-local address' do - Addrinfo.ip('ff11::').ipv6_mc_nodelocal?.should == true - Addrinfo.ip('ff01::').ipv6_mc_nodelocal?.should == true - Addrinfo.ip('fff1::').ipv6_mc_nodelocal?.should == true - Addrinfo.ip('ff11::1').ipv6_mc_nodelocal?.should == true + Addrinfo.ip('ff11::').should.ipv6_mc_nodelocal? + Addrinfo.ip('ff01::').should.ipv6_mc_nodelocal? + Addrinfo.ip('fff1::').should.ipv6_mc_nodelocal? + Addrinfo.ip('ff11::1').should.ipv6_mc_nodelocal? end it 'returns false for a regular IPv6 address' do - Addrinfo.ip('::1').ipv6_mc_nodelocal?.should == false + Addrinfo.ip('::1').should_not.ipv6_mc_nodelocal? end it 'returns false for an IPv4 address' do - Addrinfo.ip('127.0.0.1').ipv6_mc_nodelocal?.should == false + Addrinfo.ip('127.0.0.1').should_not.ipv6_mc_nodelocal? end end diff --git a/spec/ruby/library/socket/addrinfo/ipv6_mc_orglocal_spec.rb b/spec/ruby/library/socket/addrinfo/ipv6_mc_orglocal_spec.rb index 90653dd49c..2977a98d30 100644 --- a/spec/ruby/library/socket/addrinfo/ipv6_mc_orglocal_spec.rb +++ b/spec/ruby/library/socket/addrinfo/ipv6_mc_orglocal_spec.rb @@ -2,17 +2,17 @@ require_relative '../spec_helper' describe 'Addrinfo#ipv6_mc_orglocal?' do it 'returns true for a multi-cast org-local address' do - Addrinfo.ip('ff18::').ipv6_mc_orglocal?.should == true - Addrinfo.ip('ff08::').ipv6_mc_orglocal?.should == true - Addrinfo.ip('fff8::').ipv6_mc_orglocal?.should == true - Addrinfo.ip('ff18::1').ipv6_mc_orglocal?.should == true + Addrinfo.ip('ff18::').should.ipv6_mc_orglocal? + Addrinfo.ip('ff08::').should.ipv6_mc_orglocal? + Addrinfo.ip('fff8::').should.ipv6_mc_orglocal? + Addrinfo.ip('ff18::1').should.ipv6_mc_orglocal? end it 'returns false for a regular IPv6 address' do - Addrinfo.ip('::1').ipv6_mc_orglocal?.should == false + Addrinfo.ip('::1').should_not.ipv6_mc_orglocal? end it 'returns false for an IPv4 address' do - Addrinfo.ip('127.0.0.1').ipv6_mc_orglocal?.should == false + Addrinfo.ip('127.0.0.1').should_not.ipv6_mc_orglocal? end end diff --git a/spec/ruby/library/socket/addrinfo/ipv6_mc_sitelocal_spec.rb b/spec/ruby/library/socket/addrinfo/ipv6_mc_sitelocal_spec.rb index 686b625e0d..58e5976a40 100644 --- a/spec/ruby/library/socket/addrinfo/ipv6_mc_sitelocal_spec.rb +++ b/spec/ruby/library/socket/addrinfo/ipv6_mc_sitelocal_spec.rb @@ -2,17 +2,17 @@ require_relative '../spec_helper' describe 'Addrinfo#ipv6_mc_sitelocal?' do it 'returns true for a multi-cast site-local address' do - Addrinfo.ip('ff15::').ipv6_mc_sitelocal?.should == true - Addrinfo.ip('ff05::').ipv6_mc_sitelocal?.should == true - Addrinfo.ip('fff5::').ipv6_mc_sitelocal?.should == true - Addrinfo.ip('ff15::1').ipv6_mc_sitelocal?.should == true + Addrinfo.ip('ff15::').should.ipv6_mc_sitelocal? + Addrinfo.ip('ff05::').should.ipv6_mc_sitelocal? + Addrinfo.ip('fff5::').should.ipv6_mc_sitelocal? + Addrinfo.ip('ff15::1').should.ipv6_mc_sitelocal? end it 'returns false for a regular IPv6 address' do - Addrinfo.ip('::1').ipv6_mc_sitelocal?.should == false + Addrinfo.ip('::1').should_not.ipv6_mc_sitelocal? end it 'returns false for an IPv4 address' do - Addrinfo.ip('127.0.0.1').ipv6_mc_sitelocal?.should == false + Addrinfo.ip('127.0.0.1').should_not.ipv6_mc_sitelocal? end end diff --git a/spec/ruby/library/socket/addrinfo/ipv6_multicast_spec.rb b/spec/ruby/library/socket/addrinfo/ipv6_multicast_spec.rb index c25322869c..2c987b5921 100644 --- a/spec/ruby/library/socket/addrinfo/ipv6_multicast_spec.rb +++ b/spec/ruby/library/socket/addrinfo/ipv6_multicast_spec.rb @@ -18,19 +18,19 @@ describe "Addrinfo#ipv6_multicast?" do describe "for an ipv6 socket" do it "returns true for a multicast address" do - Addrinfo.ip('ff00::').ipv6_multicast?.should == true - Addrinfo.ip('ff00::1').ipv6_multicast?.should == true - Addrinfo.ip('ff08::1').ipv6_multicast?.should == true - Addrinfo.ip('fff8::1').ipv6_multicast?.should == true + Addrinfo.ip('ff00::').should.ipv6_multicast? + Addrinfo.ip('ff00::1').should.ipv6_multicast? + Addrinfo.ip('ff08::1').should.ipv6_multicast? + Addrinfo.ip('fff8::1').should.ipv6_multicast? - Addrinfo.ip('ff02::').ipv6_multicast?.should == true - Addrinfo.ip('ff02::1').ipv6_multicast?.should == true - Addrinfo.ip('ff0f::').ipv6_multicast?.should == true + Addrinfo.ip('ff02::').should.ipv6_multicast? + Addrinfo.ip('ff02::1').should.ipv6_multicast? + Addrinfo.ip('ff0f::').should.ipv6_multicast? end it "returns false for another address" do - Addrinfo.ip('::1').ipv6_multicast?.should == false - Addrinfo.ip('fe80::').ipv6_multicast?.should == false + Addrinfo.ip('::1').should_not.ipv6_multicast? + Addrinfo.ip('fe80::').should_not.ipv6_multicast? end end diff --git a/spec/ruby/library/socket/addrinfo/ipv6_sitelocal_spec.rb b/spec/ruby/library/socket/addrinfo/ipv6_sitelocal_spec.rb index dd202a1749..9158eb5809 100644 --- a/spec/ruby/library/socket/addrinfo/ipv6_sitelocal_spec.rb +++ b/spec/ruby/library/socket/addrinfo/ipv6_sitelocal_spec.rb @@ -5,19 +5,19 @@ guard -> { SocketSpecs.ipv6_available? } do describe 'Addrinfo#ipv6_sitelocal?' do platform_is_not :aix do it 'returns true for a site-local address' do - Addrinfo.ip('feef::').ipv6_sitelocal?.should == true - Addrinfo.ip('fee0::').ipv6_sitelocal?.should == true - Addrinfo.ip('fee2::').ipv6_sitelocal?.should == true - Addrinfo.ip('feef::1').ipv6_sitelocal?.should == true + Addrinfo.ip('feef::').should.ipv6_sitelocal? + Addrinfo.ip('fee0::').should.ipv6_sitelocal? + Addrinfo.ip('fee2::').should.ipv6_sitelocal? + Addrinfo.ip('feef::1').should.ipv6_sitelocal? end end it 'returns false for a regular IPv6 address' do - Addrinfo.ip('::1').ipv6_sitelocal?.should == false + Addrinfo.ip('::1').should_not.ipv6_sitelocal? end it 'returns false for an IPv4 address' do - Addrinfo.ip('127.0.0.1').ipv6_sitelocal?.should == false + Addrinfo.ip('127.0.0.1').should_not.ipv6_sitelocal? end end end diff --git a/spec/ruby/library/socket/addrinfo/ipv6_unique_local_spec.rb b/spec/ruby/library/socket/addrinfo/ipv6_unique_local_spec.rb index b80a15fcb0..22f0fa3b75 100644 --- a/spec/ruby/library/socket/addrinfo/ipv6_unique_local_spec.rb +++ b/spec/ruby/library/socket/addrinfo/ipv6_unique_local_spec.rb @@ -2,17 +2,17 @@ require_relative '../spec_helper' describe 'Addrinfo#ipv6_unique_local?' do it 'returns true for an unique local IPv6 address' do - Addrinfo.ip('fc00::').ipv6_unique_local?.should == true - Addrinfo.ip('fd00::').ipv6_unique_local?.should == true - Addrinfo.ip('fcff::').ipv6_unique_local?.should == true + Addrinfo.ip('fc00::').should.ipv6_unique_local? + Addrinfo.ip('fd00::').should.ipv6_unique_local? + Addrinfo.ip('fcff::').should.ipv6_unique_local? end it 'returns false for a regular IPv6 address' do - Addrinfo.ip('::1').ipv6_unique_local?.should == false - Addrinfo.ip('fe00::').ipv6_unique_local?.should == false + Addrinfo.ip('::1').should_not.ipv6_unique_local? + Addrinfo.ip('fe00::').should_not.ipv6_unique_local? end it 'returns false for an IPv4 address' do - Addrinfo.ip('127.0.0.1').ipv6_unique_local?.should == false + Addrinfo.ip('127.0.0.1').should_not.ipv6_unique_local? end end diff --git a/spec/ruby/library/socket/addrinfo/ipv6_unspecified_spec.rb b/spec/ruby/library/socket/addrinfo/ipv6_unspecified_spec.rb index dd79d57503..d63979ceda 100644 --- a/spec/ruby/library/socket/addrinfo/ipv6_unspecified_spec.rb +++ b/spec/ruby/library/socket/addrinfo/ipv6_unspecified_spec.rb @@ -2,14 +2,14 @@ require_relative '../spec_helper' describe 'Addrinfo#ipv6_unspecified?' do it 'returns true for an unspecified IPv6 address' do - Addrinfo.ip('::').ipv6_unspecified?.should == true + Addrinfo.ip('::').should.ipv6_unspecified? end it 'returns false for a regular IPv6 address' do - Addrinfo.ip('::1').ipv6_unspecified?.should == false + Addrinfo.ip('::1').should_not.ipv6_unspecified? end it 'returns false for an IPv4 address' do - Addrinfo.ip('127.0.0.1').ipv6_unspecified?.should == false + Addrinfo.ip('127.0.0.1').should_not.ipv6_unspecified? end end diff --git a/spec/ruby/library/socket/addrinfo/ipv6_v4compat_spec.rb b/spec/ruby/library/socket/addrinfo/ipv6_v4compat_spec.rb index ab8388a21b..21ca85af99 100644 --- a/spec/ruby/library/socket/addrinfo/ipv6_v4compat_spec.rb +++ b/spec/ruby/library/socket/addrinfo/ipv6_v4compat_spec.rb @@ -2,19 +2,19 @@ require_relative '../spec_helper' describe 'Addrinfo#ipv6_v4compat?' do it 'returns true for an IPv4 compatible address' do - Addrinfo.ip('::127.0.0.1').ipv6_v4compat?.should == true - Addrinfo.ip('::192.168.1.1').ipv6_v4compat?.should == true + Addrinfo.ip('::127.0.0.1').should.ipv6_v4compat? + Addrinfo.ip('::192.168.1.1').should.ipv6_v4compat? end it 'returns false for an IPv4 mapped address' do - Addrinfo.ip('::ffff:192.168.1.1').ipv6_v4compat?.should == false + Addrinfo.ip('::ffff:192.168.1.1').should_not.ipv6_v4compat? end it 'returns false for a regular IPv6 address' do - Addrinfo.ip('::1').ipv6_v4compat?.should == false + Addrinfo.ip('::1').should_not.ipv6_v4compat? end it 'returns false for an IPv4 address' do - Addrinfo.ip('127.0.0.1').ipv6_v4compat?.should == false + Addrinfo.ip('127.0.0.1').should_not.ipv6_v4compat? end end diff --git a/spec/ruby/library/socket/addrinfo/ipv6_v4mapped_spec.rb b/spec/ruby/library/socket/addrinfo/ipv6_v4mapped_spec.rb index 82b272c165..7dac0e75db 100644 --- a/spec/ruby/library/socket/addrinfo/ipv6_v4mapped_spec.rb +++ b/spec/ruby/library/socket/addrinfo/ipv6_v4mapped_spec.rb @@ -2,19 +2,19 @@ require_relative '../spec_helper' describe 'Addrinfo#ipv6_v4mapped?' do it 'returns true for an IPv4 compatible address' do - Addrinfo.ip('::ffff:192.168.1.1').ipv6_v4mapped?.should == true + Addrinfo.ip('::ffff:192.168.1.1').should.ipv6_v4mapped? end it 'returns false for an IPv4 compatible address' do - Addrinfo.ip('::192.168.1.1').ipv6_v4mapped?.should == false - Addrinfo.ip('::127.0.0.1').ipv6_v4mapped?.should == false + Addrinfo.ip('::192.168.1.1').should_not.ipv6_v4mapped? + Addrinfo.ip('::127.0.0.1').should_not.ipv6_v4mapped? end it 'returns false for a regular IPv6 address' do - Addrinfo.ip('::1').ipv6_v4mapped?.should == false + Addrinfo.ip('::1').should_not.ipv6_v4mapped? end it 'returns false for an IPv4 address' do - Addrinfo.ip('127.0.0.1').ipv6_v4mapped?.should == false + Addrinfo.ip('127.0.0.1').should_not.ipv6_v4mapped? end end diff --git a/spec/ruby/library/socket/addrinfo/listen_spec.rb b/spec/ruby/library/socket/addrinfo/listen_spec.rb index 714a96ed6c..931093f732 100644 --- a/spec/ruby/library/socket/addrinfo/listen_spec.rb +++ b/spec/ruby/library/socket/addrinfo/listen_spec.rb @@ -29,6 +29,6 @@ describe 'Addrinfo#listen' do socket = sock end - socket.closed?.should == true + socket.should.closed? end end diff --git a/spec/ruby/library/socket/basicsocket/read_nonblock_spec.rb b/spec/ruby/library/socket/basicsocket/read_nonblock_spec.rb index 4986fffbc5..b8def7e930 100644 --- a/spec/ruby/library/socket/basicsocket/read_nonblock_spec.rb +++ b/spec/ruby/library/socket/basicsocket/read_nonblock_spec.rb @@ -24,20 +24,20 @@ describe "BasicSocket#read_nonblock" do platform_is :linux do it 'does not set the IO in nonblock mode' do require 'io/nonblock' - @r.nonblock?.should == false + @r.should_not.nonblock? IO.select([@r], nil, nil, 2) @r.read_nonblock(3).should == "aaa" - @r.nonblock?.should == false + @r.should_not.nonblock? end end platform_is_not :linux, :windows do it 'sets the IO in nonblock mode' do require 'io/nonblock' - @r.nonblock?.should == false + @r.should_not.nonblock? IO.select([@r], nil, nil, 2) @r.read_nonblock(3).should == "aaa" - @r.nonblock?.should == true + @r.should.nonblock? end end end diff --git a/spec/ruby/library/socket/basicsocket/write_nonblock_spec.rb b/spec/ruby/library/socket/basicsocket/write_nonblock_spec.rb index 95ec08a6c7..c385beab24 100644 --- a/spec/ruby/library/socket/basicsocket/write_nonblock_spec.rb +++ b/spec/ruby/library/socket/basicsocket/write_nonblock_spec.rb @@ -25,18 +25,18 @@ describe "BasicSocket#write_nonblock" do platform_is :linux do it 'does not set the IO in nonblock mode' do require 'io/nonblock' - @w.nonblock?.should == false + @w.should_not.nonblock? @w.write_nonblock("aaa").should == 3 - @w.nonblock?.should == false + @w.should_not.nonblock? end end platform_is_not :linux, :windows do it 'sets the IO in nonblock mode' do require 'io/nonblock' - @w.nonblock?.should == false + @w.should_not.nonblock? @w.write_nonblock("aaa").should == 3 - @w.nonblock?.should == true + @w.should.nonblock? end end end diff --git a/spec/ruby/library/socket/socket/tcp_server_sockets_spec.rb b/spec/ruby/library/socket/socket/tcp_server_sockets_spec.rb index 10c030a8ce..bd496d3015 100644 --- a/spec/ruby/library/socket/socket/tcp_server_sockets_spec.rb +++ b/spec/ruby/library/socket/socket/tcp_server_sockets_spec.rb @@ -32,7 +32,7 @@ describe 'Socket.tcp_server_sockets' do Socket.tcp_server_sockets(0) { |socks| sockets = socks } sockets.each do |socket| - socket.closed?.should == true + socket.should.closed? end end end diff --git a/spec/ruby/library/socket/socket/tcp_spec.rb b/spec/ruby/library/socket/socket/tcp_spec.rb index d36e3e6adb..faf020b1ea 100644 --- a/spec/ruby/library/socket/socket/tcp_spec.rb +++ b/spec/ruby/library/socket/socket/tcp_spec.rb @@ -36,7 +36,7 @@ describe 'Socket.tcp' do @socket = socket end - @socket.closed?.should == true + @socket.should.closed? end it 'binds to a local address and port when specified' do diff --git a/spec/ruby/library/socket/socket/udp_server_sockets_spec.rb b/spec/ruby/library/socket/socket/udp_server_sockets_spec.rb index 3aeb472dda..f8be672612 100644 --- a/spec/ruby/library/socket/socket/udp_server_sockets_spec.rb +++ b/spec/ruby/library/socket/socket/udp_server_sockets_spec.rb @@ -32,7 +32,7 @@ describe 'Socket.udp_server_sockets' do Socket.udp_server_sockets(0) { |socks| sockets = socks } sockets.each do |socket| - socket.closed?.should == true + socket.should.closed? end end end diff --git a/spec/ruby/library/socket/socket/unix_spec.rb b/spec/ruby/library/socket/socket/unix_spec.rb index add54a097d..4bff59bd4b 100644 --- a/spec/ruby/library/socket/socket/unix_spec.rb +++ b/spec/ruby/library/socket/socket/unix_spec.rb @@ -38,7 +38,7 @@ with_feature :unix_socket do socket = sock end - socket.closed?.should == true + socket.should.closed? end end end diff --git a/spec/ruby/library/socket/unixsocket/open_spec.rb b/spec/ruby/library/socket/unixsocket/open_spec.rb index ad5048fedd..99ad151bb8 100644 --- a/spec/ruby/library/socket/unixsocket/open_spec.rb +++ b/spec/ruby/library/socket/unixsocket/open_spec.rb @@ -21,7 +21,7 @@ describe "UNIXSocket.open" do it "opens a unix socket on the specified file and yields it to the block" do UNIXSocket.open(@path) do |client| client.addr[0].should == "AF_UNIX" - client.closed?.should == false + client.should_not.closed? end end end diff --git a/spec/ruby/library/socket/unixsocket/shared/new.rb b/spec/ruby/library/socket/unixsocket/shared/new.rb index 76a4e1701e..bfb7ed3886 100644 --- a/spec/ruby/library/socket/unixsocket/shared/new.rb +++ b/spec/ruby/library/socket/unixsocket/shared/new.rb @@ -18,7 +18,7 @@ describe :unixsocket_new, shared: true do @client = UNIXSocket.send(@method, @path) @client.addr[0].should == "AF_UNIX" - @client.closed?.should == false + @client.should_not.closed? end end end diff --git a/spec/ruby/library/stringio/reopen_spec.rb b/spec/ruby/library/stringio/reopen_spec.rb index ab0a3331d2..9943978377 100644 --- a/spec/ruby/library/stringio/reopen_spec.rb +++ b/spec/ruby/library/stringio/reopen_spec.rb @@ -283,7 +283,7 @@ describe "StringIO#reopen" do new_io = StringIO.new("tainted") new_io.taint @io.reopen(new_io) - @io.tainted?.should == true + @io.should.tainted? end end diff --git a/spec/ruby/library/syslog/close_spec.rb b/spec/ruby/library/syslog/close_spec.rb index 8186ecf125..8c3b67c05b 100644 --- a/spec/ruby/library/syslog/close_spec.rb +++ b/spec/ruby/library/syslog/close_spec.rb @@ -30,7 +30,7 @@ platform_is_not :windows do -> { Syslog.open { |s| s.close } }.should raise_error(RuntimeError) - Syslog.opened?.should == false + Syslog.should_not.opened? end it "sets the identity to nil" do diff --git a/spec/ruby/library/syslog/ident_spec.rb b/spec/ruby/library/syslog/ident_spec.rb index e8345ebb49..3b08327140 100644 --- a/spec/ruby/library/syslog/ident_spec.rb +++ b/spec/ruby/library/syslog/ident_spec.rb @@ -21,7 +21,7 @@ platform_is_not :windows do end it "returns nil if the log is closed" do - Syslog.opened?.should == false + Syslog.should_not.opened? Syslog.ident.should == nil end diff --git a/spec/ruby/library/syslog/mask_spec.rb b/spec/ruby/library/syslog/mask_spec.rb index 6581f6a756..b3f1250b24 100644 --- a/spec/ruby/library/syslog/mask_spec.rb +++ b/spec/ruby/library/syslog/mask_spec.rb @@ -32,7 +32,7 @@ platform_is_not :windows do end it "returns nil if the log is closed" do - Syslog.opened?.should == false + Syslog.should_not.opened? Syslog.mask.should == nil end diff --git a/spec/ruby/library/weakref/weakref_alive_spec.rb b/spec/ruby/library/weakref/weakref_alive_spec.rb index 173ea01485..1ebf9c1ee3 100644 --- a/spec/ruby/library/weakref/weakref_alive_spec.rb +++ b/spec/ruby/library/weakref/weakref_alive_spec.rb @@ -5,7 +5,7 @@ describe "WeakRef#weakref_alive?" do it "returns true if the object is reachable" do obj = Object.new ref = WeakRef.new(obj) - ref.weakref_alive?.should == true + ref.weakref_alive?.should be_true end it "returns a falsy value if the object is no longer reachable" do diff --git a/spec/ruby/library/win32ole/win32ole_param/input_spec.rb b/spec/ruby/library/win32ole/win32ole_param/input_spec.rb index a0022fef13..e2a90daa56 100644 --- a/spec/ruby/library/win32ole/win32ole_param/input_spec.rb +++ b/spec/ruby/library/win32ole/win32ole_param/input_spec.rb @@ -13,7 +13,7 @@ platform_is :windows do end it "returns true for 3rd parameter of FileSystemObject's 'CopyFile' method" do - @param_overwritefiles.input?.should == true + @param_overwritefiles.should.input? end end diff --git a/spec/ruby/library/zlib/gzipfile/close_spec.rb b/spec/ruby/library/zlib/gzipfile/close_spec.rb index 870870f2fa..964b5ffb4d 100644 --- a/spec/ruby/library/zlib/gzipfile/close_spec.rb +++ b/spec/ruby/library/zlib/gzipfile/close_spec.rb @@ -8,7 +8,7 @@ describe "Zlib::GzipFile#close" do Zlib::GzipWriter.wrap io do |gzio| gzio.close - gzio.closed?.should == true + gzio.should.closed? -> { gzio.orig_name }.should \ raise_error(Zlib::GzipFile::Error, 'closed gzip stream') diff --git a/spec/ruby/library/zlib/gzipfile/closed_spec.rb b/spec/ruby/library/zlib/gzipfile/closed_spec.rb index b885add485..726f391b41 100644 --- a/spec/ruby/library/zlib/gzipfile/closed_spec.rb +++ b/spec/ruby/library/zlib/gzipfile/closed_spec.rb @@ -6,11 +6,11 @@ describe "Zlib::GzipFile#closed?" do it "returns the closed status" do io = StringIO.new Zlib::GzipWriter.wrap io do |gzio| - gzio.closed?.should == false + gzio.should_not.closed? gzio.close - gzio.closed?.should == true + gzio.should.closed? end end end diff --git a/spec/ruby/library/zlib/zstream/flush_next_out_spec.rb b/spec/ruby/library/zlib/zstream/flush_next_out_spec.rb index 59a0622903..63676a8203 100644 --- a/spec/ruby/library/zlib/zstream/flush_next_out_spec.rb +++ b/spec/ruby/library/zlib/zstream/flush_next_out_spec.rb @@ -8,7 +8,7 @@ describe "Zlib::ZStream#flush_next_out" do zs << [120, 156, 75, 203, 207, 7, 0, 2, 130, 1, 69].pack('C*') zs.flush_next_out.should == 'foo' - zs.finished?.should == true + zs.should.finished? zs.flush_next_out.should == '' end end diff --git a/spec/ruby/optional/capi/kernel_spec.rb b/spec/ruby/optional/capi/kernel_spec.rb index ff88203501..cbd0a50dea 100644 --- a/spec/ruby/optional/capi/kernel_spec.rb +++ b/spec/ruby/optional/capi/kernel_spec.rb @@ -9,7 +9,7 @@ describe "C-API Kernel function" do describe "rb_block_given_p" do it "returns false if no block is passed" do - @s.rb_block_given_p.should == false + @s.should_not.rb_block_given_p end it "returns true if a block is passed" do @@ -483,7 +483,7 @@ describe "C-API Kernel function" do proc = @s.rb_block_proc { 1+1 } proc.should be_kind_of(Proc) proc.call.should == 2 - proc.lambda?.should == false + proc.should_not.lambda? end it "passes through an existing lambda and does not convert to a proc" do @@ -491,7 +491,7 @@ describe "C-API Kernel function" do proc = @s.rb_block_proc(&b) proc.should equal(b) proc.call.should == 2 - proc.lambda?.should == true + proc.should.lambda? end end @@ -500,7 +500,7 @@ describe "C-API Kernel function" do proc = @s.rb_block_lambda { 1+1 } proc.should be_kind_of(Proc) proc.call.should == 2 - proc.lambda?.should == true + proc.should.lambda? end it "passes through an existing Proc and does not convert to a lambda" do @@ -508,7 +508,7 @@ describe "C-API Kernel function" do proc = @s.rb_block_lambda(&b) proc.should equal(b) proc.call.should == 2 - proc.lambda?.should == false + proc.should_not.lambda? end end diff --git a/spec/ruby/optional/capi/object_spec.rb b/spec/ruby/optional/capi/object_spec.rb index 8b9e8bbc25..bbcaec2ba8 100644 --- a/spec/ruby/optional/capi/object_spec.rb +++ b/spec/ruby/optional/capi/object_spec.rb @@ -675,9 +675,9 @@ describe "CApiObject" do ruby_version_is ''...'2.7' do it "marks the object passed as tainted" do obj = "" - obj.tainted?.should == false + obj.should_not.tainted? @o.rb_obj_taint(obj) - obj.tainted?.should == true + obj.should.tainted? end it "raises a FrozenError if the object passed is frozen" do diff --git a/spec/ruby/optional/capi/shared/rbasic.rb b/spec/ruby/optional/capi/shared/rbasic.rb index 40761122ef..c25733f862 100644 --- a/spec/ruby/optional/capi/shared/rbasic.rb +++ b/spec/ruby/optional/capi/shared/rbasic.rb @@ -17,7 +17,7 @@ describe :rbasic, shared: true do obj, _ = @data.call initial = @specs.get_flags(obj) @specs.set_flags(obj, @freeze | initial).should == @freeze | initial - obj.frozen?.should == true + obj.should.frozen? end ruby_version_is ""..."2.7" do @@ -41,16 +41,16 @@ describe :rbasic, shared: true do obj, _ = @data.call initial = @specs.get_flags(obj) @specs.set_flags(obj, @taint | initial).should == @taint | initial - obj.tainted?.should == true + obj.should.tainted? @specs.set_flags(obj, initial).should == initial - obj.tainted?.should == false + obj.should_not.tainted? @specs.set_flags(obj, @freeze | initial).should == @freeze | initial - obj.frozen?.should == true + obj.should.frozen? obj, _ = @data.call @specs.set_flags(obj, @freeze | @taint | initial).should == @freeze | @taint | initial - obj.tainted?.should == true - obj.frozen?.should == true + obj.should.tainted? + obj.should.frozen? end end diff --git a/spec/ruby/optional/capi/string_spec.rb b/spec/ruby/optional/capi/string_spec.rb index 224d63f886..57ac9545f4 100644 --- a/spec/ruby/optional/capi/string_spec.rb +++ b/spec/ruby/optional/capi/string_spec.rb @@ -76,7 +76,7 @@ describe "C-API String function" do it "invalidates the code range" do @s.rb_str_set_len(@str, 4) - @str.ascii_only?.should == true + @str.should.ascii_only? end it "updates the string's attributes visible in C code" do @@ -183,7 +183,7 @@ describe "C-API String function" do ruby_version_is ''...'2.7' do it "returns a non-tainted string" do - @s.rb_str_new("hello", 5).tainted?.should == false + @s.rb_str_new("hello", 5).should_not.tainted? end end @@ -288,8 +288,8 @@ describe "C-API String function" do str2 = @s.rb_str_new4 str1 str1.should == str2 str1.should equal(str2) - str1.frozen?.should == true - str2.frozen?.should == true + str1.should.frozen? + str2.should.frozen? end it "returns a frozen copy of the string" do @@ -297,7 +297,7 @@ describe "C-API String function" do str2 = @s.rb_str_new4 str1 str1.should == str2 str1.should_not equal(str2) - str2.frozen?.should == true + str2.should.frozen? end end diff --git a/spec/ruby/optional/capi/tracepoint_spec.rb b/spec/ruby/optional/capi/tracepoint_spec.rb index 6aeac54921..2043b7c941 100644 --- a/spec/ruby/optional/capi/tracepoint_spec.rb +++ b/spec/ruby/optional/capi/tracepoint_spec.rb @@ -15,7 +15,7 @@ describe "CApiTracePointSpecs" do it "returns a tracepoint object" do @trace = @s.rb_tracepoint_new(7) @trace.should be_an_instance_of(TracePoint) - @trace.enabled?.should == false + @trace.should_not.enabled? end it "traces lines when given RUBY_EVENT_LINE" do @@ -28,20 +28,20 @@ describe "CApiTracePointSpecs" do describe "rb_tracepoint_disable" do it "disables an enabled TracePoint" do @trace = @s.rb_tracepoint_new(9) - @trace.enabled?.should == false + @trace.should_not.enabled? @trace.enable - @trace.enabled?.should == true + @trace.should.enabled? @s.rb_tracepoint_disable(@trace).should == false - @trace.enabled?.should == false + @trace.should_not.enabled? end end describe "rb_tracepoint_enable" do it "enables a disabled TracePoint" do @trace = @s.rb_tracepoint_new(10) - @trace.enabled?.should == false + @trace.should_not.enabled? @s.rb_tracepoint_enable(@trace).should == true - @trace.enabled?.should == true + @trace.should.enabled? end end diff --git a/spec/ruby/security/cve_2020_10663_spec.rb b/spec/ruby/security/cve_2020_10663_spec.rb index e305c0b593..634afda525 100644 --- a/spec/ruby/security/cve_2020_10663_spec.rb +++ b/spec/ruby/security/cve_2020_10663_spec.rb @@ -26,7 +26,7 @@ guard -> { describe "CVE-2020-10663 is resisted by" do it "only creating custom objects if passed create_additions: true or using JSON.load" do obj = JSONSpecs::MyClass.new("bar") - JSONSpecs::MyClass.json_creatable?.should == true + JSONSpecs::MyClass.should.json_creatable? json = JSON.dump(obj) JSON.parse(json, create_additions: true).class.should == JSONSpecs::MyClass diff --git a/spec/ruby/shared/string/times.rb b/spec/ruby/shared/string/times.rb index 6b45f7aa1e..6827db2271 100644 --- a/spec/ruby/shared/string/times.rb +++ b/spec/ruby/shared/string/times.rb @@ -38,7 +38,7 @@ describe :string_times, shared: true do str.taint [0, 1, 2].each do |arg| - @object.call(str, arg).tainted?.should == true + @object.call(str, arg).should.tainted? end end end