Skip to content

Commit e3f67f1

Browse files
committed
Create chaining.test.rb
1 parent 86ab73a commit e3f67f1

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

test/rspec/chaining.test.rb

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# frozen_string_literal: true
2+
3+
require "quickdraw/rspec"
4+
5+
Quickdraw::RSpec.describe "and chaining" do
6+
it "passes when both matchers pass" do
7+
expect(5).to (be > 3).and(be < 10)
8+
end
9+
10+
it "works with equality matchers" do
11+
expect("hello").to be_a(String).and eq("hello")
12+
end
13+
end
14+
15+
Quickdraw::RSpec.describe "or chaining" do
16+
it "passes when first matcher passes" do
17+
expect(5).to eq(5).or(eq(10))
18+
end
19+
20+
it "passes when second matcher passes" do
21+
expect(10).to eq(5).or(eq(10))
22+
end
23+
24+
it "passes when both matchers pass" do
25+
expect(5).to eq(5).or(eq(5))
26+
end
27+
end

0 commit comments

Comments
 (0)