ex_aequo_rspex 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b4f244299f4e6b28f593a335f19193fc98d06e981292f37aa758b06508eaeb7e
4
- data.tar.gz: 560df1bb3fcf7b61bf5eac9798416414548cb769692ccf962fe7e8d1669e27cd
3
+ metadata.gz: ceded2826c2e982fde7850551853a07acebe5508d18b85b4d8aaf6436a32a99b
4
+ data.tar.gz: 478e016712575d845fb04b5bd76b01a630ed08b019688d069f9945292fbb8115
5
5
  SHA512:
6
- metadata.gz: 18d23d34bb2cd51b424af891178543e513aa096999878df40a5bc0d2bd26035ac93f8dbf544f5ebe91e1ae1110ee8a45861fa7aa83878b0264ddc9d5d9aded86
7
- data.tar.gz: 9cc3edef9410b1c159cd78095a4c3df2dc9358fe0cc70dc98eb53c2815f45c109edb0d231b0a0d3b858efe862febe057f184d6143fe3e06c7a58944400f23420
6
+ metadata.gz: 5dab66505fc413238f36662612c92f630831f5f7ac9badc4f7525ce32068a9aa4f4bad2a76796c6c5e57f31fa091f8d9e99460bcbb6570ea12c2242cfb1982e0
7
+ data.tar.gz: 2fe4205f1fd1aa99aa61938d70e4b0d93abc4c65766beee19fc025ff61ffedc45139cfc64d8de3e0d59f2c597dd003dd08a22290d39e287295e8c8277f9ec32a
@@ -25,20 +25,46 @@ module ExAequo
25
25
  expect(actual).to send("be_#{predicate}", *args)
26
26
  end
27
27
 
28
- def it_is_between(lower, higher, *args, &blk)
28
+ def it_is_between(lower, higher, &blk)
29
29
  actual = blk ? instance_eval(&blk) : subject
30
30
  expect(actual).to be_between(lower, higher)
31
31
  end
32
32
 
33
+ def it_is_false(&blk) = it_equals(false, &blk)
34
+
35
+ def it_is_falsy(&blk)
36
+ actual = blk ? instance_eval(&blk) : subject
37
+ expect(actual).to be_falsy
38
+ end
39
+
40
+ def it_is_true(&blk) = it_equals(true, &blk)
41
+
42
+ def it_is_truthy(&blk)
43
+ actual = blk ? instance_eval(&blk) : subject
44
+ expect(actual).to be_truthy
45
+ end
46
+
33
47
  def it_is_not(predicate, *args, &blk)
34
48
  actual = blk ? instance_eval(&blk) : subject
35
49
  expect(actual).not_to send("be_#{predicate}", *args)
36
50
  end
37
51
 
52
+ def it_matches(matcher, &blk)
53
+ actual = blk ? instance_eval(&blk) : subject
54
+ expect(actual).to match(matcher)
55
+ end
56
+
38
57
  def it_raises(exception, message=nil, &blk)
39
58
  expect { blk ? instance_eval(&blk) : subject }
40
59
  .to raise_error(exception, message)
41
60
  end
61
+
62
+ def it_puts(lines, to: $stdout, &blk)
63
+ lines.each do
64
+ expect(to).to receive(:puts).with(it).ordered
65
+ end
66
+ blk ? instance_eval(&blk) : subject
67
+ end
42
68
  end
43
69
  end
44
70
  end
@@ -5,16 +5,16 @@ module ExAequo
5
5
  module Macros
6
6
  module SubjectMacros
7
7
 
8
- def it_eq(value, &blk)
9
- specify do
8
+ def it_eq(value, name: nil, &blk)
9
+ specify name do
10
10
  it_eq(value, &blk)
11
11
  end
12
12
  end
13
13
  alias_method :it_equals, :it_eq
14
14
 
15
- def it_fails_spec(message=nil, &blk)
16
- specify do
17
- it_raises(RSpec::Expectations::ExpectationNotMetError, message, &blk)
15
+ def it_fails_spec(message=nil, with: RSpec::Expectations::ExpectationNotMetError, &blk)
16
+ specify name do
17
+ it_raises(with, message, &blk)
18
18
  end
19
19
  end
20
20
 
@@ -30,9 +30,16 @@ module ExAequo
30
30
  end
31
31
  end
32
32
 
33
- def it_is_between(lower, higher, *args, &blk)
34
- specify do
35
- it_is_between(lower, higher, *args, &blk)
33
+ def it_is_between(lower, higher, name: nil, &blk)
34
+ specify name do
35
+ it_is_between(lower, higher, &blk)
36
+ end
37
+ end
38
+
39
+ def it_is_false(name: nil, &blk) = it_eq(false, name:, &blk)
40
+ def it_is_falsy(name: nil, &blk)
41
+ specify name do
42
+ it_is_falsy(&blk)
36
43
  end
37
44
  end
38
45
 
@@ -42,11 +49,30 @@ module ExAequo
42
49
  end
43
50
  end
44
51
 
45
- def it_raises(exception, message=nil, &blk)
46
- specify do
52
+ def it_is_true(name: nil, &blk) = it_eq(true, name:, &blk)
53
+ def it_is_truthy(name: nil, &blk)
54
+ specify name do
55
+ it_is_truthy(&blk)
56
+ end
57
+ end
58
+
59
+ def it_matches(matcher, name: nil, &blk)
60
+ specify name do
61
+ it_matches(matcher, &blk)
62
+ end
63
+ end
64
+
65
+ def it_raises(exception, message=nil, name: nil, &blk)
66
+ specify name do
47
67
  it_raises(exception, message, &blk)
48
68
  end
49
69
  end
70
+
71
+ def it_puts(lines, to: $stdout, name: nil, &blk)
72
+ specify name do
73
+ it_puts(lines, to:, &blk)
74
+ end
75
+ end
50
76
  end
51
77
  end
52
78
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module ExAequo
4
4
  module RSpex
5
- VERSION = '0.1.3'
5
+ VERSION = '0.1.5'
6
6
  end
7
7
  end
8
8
  # SPDX-License-Identifier: AGPL-3.0-or-later
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ex_aequo_rspex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Dober