diff options
author | Benoit Daloze <eregontp@gmail.com> | 2020-05-03 12:28:29 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2020-05-03 12:28:29 +0200 |
commit | 5aaa75e7c1f4b7912c10ffdcb1cac581e20eda39 (patch) | |
tree | e1694f5a4a5558884b1b8f3890b186793e5e982f /spec/ruby/optional | |
parent | f646d20aaeb8f02bcd3d0c5c3f5a372da654502a (diff) | |
download | ruby-5aaa75e7c1f4b7912c10ffdcb1cac581e20eda39.tar.gz |
Update to ruby/spec@032ee74
Diffstat (limited to 'spec/ruby/optional')
-rw-r--r-- | spec/ruby/optional/capi/kernel_spec.rb | 10 | ||||
-rw-r--r-- | spec/ruby/optional/capi/object_spec.rb | 4 | ||||
-rw-r--r-- | spec/ruby/optional/capi/shared/rbasic.rb | 12 | ||||
-rw-r--r-- | spec/ruby/optional/capi/string_spec.rb | 10 | ||||
-rw-r--r-- | spec/ruby/optional/capi/tracepoint_spec.rb | 12 |
5 files changed, 24 insertions, 24 deletions
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 |