ex_aequo_rspex 0.1.2 → 0.1.4

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: 1830a0eeeebf7c21a62f80d6618b67757f882609dacf27ad29397d6172316331
4
- data.tar.gz: '074892cee1c504afbf5b9907d68ff4330fbc61b00c9b11cee30e8507a4617c38'
3
+ metadata.gz: 6a6bda568c3fb65402102dff6ac95160dfdcfc003df47c78ce75be1d84f2bca4
4
+ data.tar.gz: 34e63ef3e2e29449a317cdf0167bbeffd972c6fa7d4e6626e189123ba82143bb
5
5
  SHA512:
6
- metadata.gz: e497f05e1f0beaf50f91e269dd0b006928702d521883429fc7d5c44163f5ecfd2c7ce5539d9b0c279d05ba78739120fdb3e1fcabf9c4f071eda6969582371ff7
7
- data.tar.gz: 7ebce217c25b7e44c3d0ba21862ec6f2ca7f79936c2446e4a0ed3308e9ccc5b619a45ad9e43bed7cf2617a38ddacd74c3e6f5dc4327590fa8d45ef376f48d764
6
+ metadata.gz: d935a98caa2bb64011cbeefefdb0c421689ccd692c276ac4460e0d61014a27adb8627d5d27b13e92802d785bd48a2a2867586ef817133218e5cfd4f0c4711d9c
7
+ data.tar.gz: ab0f3a9b5d9476bbd445f3962ea73f51ffb544a4edfd34fee072e1897caa40e1ab4ee897b97371c41c15c01f69e4416b9c5dc72a2eb72232ae06a0eac5cbc0f4
@@ -11,6 +11,10 @@ module ExAequo
11
11
  end
12
12
  alias_method :it_equals, :it_eq
13
13
 
14
+ def it_fails_spec(message=nil, &blk)
15
+ it_raises(RSpec::Expectations::ExpectationNotMetError, message, &blk)
16
+ end
17
+
14
18
  def it_has_ivar(name, value, &blk)
15
19
  actual = blk ? instance_eval(&blk) : subject
16
20
  expect(actual.instance_variable_get("@#{name}")).to eq(value)
@@ -21,11 +25,21 @@ module ExAequo
21
25
  expect(actual).to send("be_#{predicate}", *args)
22
26
  end
23
27
 
28
+ def it_is_between(lower, higher, &blk)
29
+ actual = blk ? instance_eval(&blk) : subject
30
+ expect(actual).to be_between(lower, higher)
31
+ end
32
+
24
33
  def it_is_not(predicate, *args, &blk)
25
34
  actual = blk ? instance_eval(&blk) : subject
26
35
  expect(actual).not_to send("be_#{predicate}", *args)
27
36
  end
28
37
 
38
+ def it_matches(matcher, &blk)
39
+ actual = blk ? instance_eval(&blk) : subject
40
+ expect(actual).to match(matcher)
41
+ end
42
+
29
43
  def it_raises(exception, message=nil, &blk)
30
44
  expect { blk ? instance_eval(&blk) : subject }
31
45
  .to raise_error(exception, message)
@@ -12,6 +12,12 @@ module ExAequo
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)
18
+ end
19
+ end
20
+
15
21
  def it_has_ivar(name, value, &blk)
16
22
  specify do
17
23
  it_has_ivar(name, value, &blk)
@@ -24,12 +30,24 @@ module ExAequo
24
30
  end
25
31
  end
26
32
 
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
+
27
39
  def it_is_not(predicate, *args, &blk)
28
40
  specify do
29
41
  it_is_not(predicate, *args, &blk)
30
42
  end
31
43
  end
32
44
 
45
+ def it_matches(matcher, name: nil, &blk)
46
+ specify name do
47
+ it_matches(matcher, &blk)
48
+ end
49
+ end
50
+
33
51
  def it_raises(exception, message=nil, &blk)
34
52
  specify do
35
53
  it_raises(exception, message, &blk)
@@ -2,7 +2,7 @@
2
2
 
3
3
  module ExAequo
4
4
  module RSpex
5
- VERSION = '0.1.2'
5
+ VERSION = '0.1.4'
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.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Dober