You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: demo.rb
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,11 @@
60
60
it "eq with nil" do
61
61
expect("Alice").to eq(nil)
62
62
end
63
+
64
+
it "eq with proc" do
65
+
helloworld = proc { "Hello, world!" }
66
+
expect(helloworld).to eq("Hello!")
67
+
end
63
68
64
69
# Identity Matchers
65
70
it "be (object identity)" do
@@ -394,7 +399,7 @@ def initialize
394
399
395
400
# Group examples by category for better organization
396
401
categories={
397
-
"Basic Equality Matchers"=>["eq with strings","eq with numbers","eq with arrays","eq with hashes","eq with nested structures","eq with array of symbols","eq with nil"],
402
+
"Basic Equality Matchers"=>["eq with strings","eq with numbers","eq with arrays","eq with hashes","eq with nested structures","eq with array of symbols","eq with nil","eq with proc"],
398
403
"Identity Matchers"=>["be (object identity)","equal (alias for be)"],
"Collection Matchers"=>["include","include with multiple items","include with hash","start_with","end_with","match (regex)","match (regex) with custom message","contain_exactly","match_array","all"],
404
409
"String Matchers"=>["match with string","unescaping quotes in actual","strings with newlines"],
"Output Matchers"=>["output to stdout","output to stderr"],
407
411
"Exception Matchers"=>["raise_error","raise_error with message","raise_error when none raised","unexpected exception (outside expect block)"],
408
412
"Other Matchers"=>["throw_symbol","exist","cover","cover multiple values","respond_to","respond_to with arguments","have_attributes","satisfy","satisfy with complex block"],
0 commit comments