There was an error while loading. Please reload this page.
1 parent 86ab73a commit e3f67f1Copy full SHA for e3f67f1
1 file changed
test/rspec/chaining.test.rb
@@ -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
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
19
20
+ it "passes when second matcher passes" do
21
+ expect(10).to eq(5).or(eq(10))
22
23
24
25
+ expect(5).to eq(5).or(eq(5))
26
27
0 commit comments