ex_aequo_rspex 0.1.4 → 0.1.6

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: 6a6bda568c3fb65402102dff6ac95160dfdcfc003df47c78ce75be1d84f2bca4
4
- data.tar.gz: 34e63ef3e2e29449a317cdf0167bbeffd972c6fa7d4e6626e189123ba82143bb
3
+ metadata.gz: 434c343c5e3d3974fc72cb76399d9ccbc7d185405c044d051381b7f28183674b
4
+ data.tar.gz: 05db995d4ae4420500f73833d85a76be2512f574b74544bedcd12ae2ca36c492
5
5
  SHA512:
6
- metadata.gz: d935a98caa2bb64011cbeefefdb0c421689ccd692c276ac4460e0d61014a27adb8627d5d27b13e92802d785bd48a2a2867586ef817133218e5cfd4f0c4711d9c
7
- data.tar.gz: ab0f3a9b5d9476bbd445f3962ea73f51ffb544a4edfd34fee072e1897caa40e1ab4ee897b97371c41c15c01f69e4416b9c5dc72a2eb72232ae06a0eac5cbc0f4
6
+ metadata.gz: 9ef50df41821cab8d931c693a2be9fa6e9c8feefe079944f3468304f2f2e4b996667636f53cf6790f61f2228d52c8b3b8943316ca494f460e5a7fd438b671de5
7
+ data.tar.gz: d10ff2efe920679a190b137be51560ecd0e904e3c408da6075f22e4dee60f0c0ce7970f0503fbff11cf3aed673a200f7a4e65ee2b5121f773a953613befb6878
@@ -30,6 +30,22 @@ module ExAequo
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_nil(&blk) = it_equals(nil, &blk)
41
+
42
+ def it_is_true(&blk) = it_equals(true, &blk)
43
+
44
+ def it_is_truthy(&blk)
45
+ actual = blk ? instance_eval(&blk) : subject
46
+ expect(actual).to be_truthy
47
+ end
48
+
33
49
  def it_is_not(predicate, *args, &blk)
34
50
  actual = blk ? instance_eval(&blk) : subject
35
51
  expect(actual).not_to send("be_#{predicate}", *args)
@@ -44,6 +60,13 @@ module ExAequo
44
60
  expect { blk ? instance_eval(&blk) : subject }
45
61
  .to raise_error(exception, message)
46
62
  end
63
+
64
+ def it_puts(lines, to: $stdout, &blk)
65
+ lines.each do
66
+ expect(to).to receive(:puts).with(it).ordered
67
+ end
68
+ blk ? instance_eval(&blk) : subject
69
+ end
47
70
  end
48
71
  end
49
72
  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
 
@@ -36,23 +36,44 @@ module ExAequo
36
36
  end
37
37
  end
38
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)
43
+ end
44
+ end
45
+
46
+ def it_is_nil(name: nil, &blk) = it_eq(nil, name:, &blk)
39
47
  def it_is_not(predicate, *args, &blk)
40
48
  specify do
41
49
  it_is_not(predicate, *args, &blk)
42
50
  end
43
51
  end
44
52
 
53
+ def it_is_true(name: nil, &blk) = it_eq(true, name:, &blk)
54
+ def it_is_truthy(name: nil, &blk)
55
+ specify name do
56
+ it_is_truthy(&blk)
57
+ end
58
+ end
59
+
45
60
  def it_matches(matcher, name: nil, &blk)
46
61
  specify name do
47
62
  it_matches(matcher, &blk)
48
63
  end
49
64
  end
50
65
 
51
- def it_raises(exception, message=nil, &blk)
52
- specify do
66
+ def it_raises(exception, message=nil, name: nil, &blk)
67
+ specify name do
53
68
  it_raises(exception, message, &blk)
54
69
  end
55
70
  end
71
+
72
+ def it_puts(lines, to: $stdout, name: nil, &blk)
73
+ specify name do
74
+ it_puts(lines, to:, &blk)
75
+ end
76
+ end
56
77
  end
57
78
  end
58
79
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module ExAequo
4
4
  module RSpex
5
- VERSION = '0.1.4'
5
+ VERSION = '0.1.6'
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.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Dober
@@ -56,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
56
  - !ruby/object:Gem::Version
57
57
  version: '0'
58
58
  requirements: []
59
- rubygems_version: 3.7.1
59
+ rubygems_version: 3.7.2
60
60
  specification_version: 4
61
61
  summary: RSpec macros and helpers
62
62
  test_files: []