summaryrefslogtreecommitdiff
path: root/spec/ruby/CONTRIBUTING.md
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2020-05-31 18:22:49 +0200
committerBenoit Daloze <eregontp@gmail.com>2020-05-31 18:22:49 +0200
commit34776105c8a6739ca3aad1de4a2c942f4a8f2f29 (patch)
tree0103cf2cc89c1322d8c3e88fff0a80b54db8320b /spec/ruby/CONTRIBUTING.md
parentf4502b001a665109bf776f9037ecbc52cb5f2d88 (diff)
Update to ruby/spec@4e486fa
Diffstat (limited to 'spec/ruby/CONTRIBUTING.md')
-rw-r--r--spec/ruby/CONTRIBUTING.md17
1 files changed, 10 insertions, 7 deletions
diff --git a/spec/ruby/CONTRIBUTING.md b/spec/ruby/CONTRIBUTING.md
index 50d8af5931..8d18f1102d 100644
--- a/spec/ruby/CONTRIBUTING.md
+++ b/spec/ruby/CONTRIBUTING.md
@@ -59,8 +59,8 @@ There are a few extra specific matchers used in the couple specs that need it.
(1 + 2).should == 3 # Calls #==
(1 + 2).should_not == 5
-File.should equal(File) # Calls #equal? (tests identity)
-(1 + 2).should eql(3) # Calls #eql? (Hash equality)
+File.should.equal?(File) # Calls #equal? (tests identity)
+(1 + 2).should.eql?(3) # Calls #eql? (Hash equality)
1.should < 2
2.should <= 2
@@ -73,11 +73,14 @@ File.should equal(File) # Calls #equal? (tests identity)
#### Predicate matchers
```ruby
-[].should be_empty # Calls #empty?
-[1,2,3].should include(2) # Calls #include?
+[].should.empty?
+[1,2,3].should.include?(2)
+
+"hello".should.start_with?("h")
+"hello".should.end_with?("o")
(0.1 + 0.2).should be_close(0.3, TOLERANCE) # (0.2-0.1).abs < TOLERANCE
-(0.0/0.0).should be_nan # Calls Float#nan?
+(0.0/0.0).should.nan?
(1.0/0.0).should be_positive_infinity
(-1.0/0.0).should be_negative_infinity
@@ -85,7 +88,7 @@ File.should equal(File) # Calls #equal? (tests identity)
3.14.should be_kind_of(Numeric) # Calls #is_a?
Numeric.should be_ancestor_of(Float) # Float.ancestors.include?(Numeric)
-3.14.should respond_to(:to_i) # Calls #respond_to?
+3.14.should.respond_to?(:to_i)
Fixnum.should have_instance_method(:+)
Array.should have_method(:new)
```
@@ -103,7 +106,7 @@ Also `have_constant`, `have_private_instance_method`, `have_singleton_method`, e
raise "oops"
}.should raise_error(RuntimeError) { |e|
# Custom checks on the Exception object
- e.message.should include("oops")
+ e.message.should.include?("oops")
e.cause.should == nil
}
```