ex_aequo_rspex 0.1.0 → 0.1.1

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: 044b062f83ca413f27da7f4a802833bf6659e0db122c17f005b76ad908ebeade
4
- data.tar.gz: 3870469b623ee3ea90922134c4aaa5dba7e8da717f15ea0a30a7a5d86199032d
3
+ metadata.gz: 54096a51f4b75569e50441df345d0fd0d91820cf2987e9cc65090c32510fdc47
4
+ data.tar.gz: b9221e4c561b2ae5e210a60d0ad64cff50baabf7765fc1d80aa058fcdca4e382
5
5
  SHA512:
6
- metadata.gz: 50c33841f3031ec70041118ee065d824ef3f8cc3c2cce966f9931bc51946a86b16cc18d4b290423c6d60dd6ee0329b48448b06e6acd3bf2730890970e8d776eb
7
- data.tar.gz: c00008945393b987f1105241f0a3274c3aa6da31470d1a3c0e335a1ca25ebca560ff2e0e379307f7e679d28de78d92a6f381631ce4a182f48e10ffd20365d70c
6
+ metadata.gz: 25cb1e89fb5b3262de3efc24cf55d471eb230feb80d7cd239404aca93417cce7734c3a965d0f89bff74b89a56db4968c3faad0ac4c5bed83555cb1c20ca0ef45
7
+ data.tar.gz: d879538cbce5956d7e9a2c59fb09d4c88547a704f27345c29b0fea9688523b40c72fe4891bbcc56c9ec47c0bb3c9eb3ba7145ae4a88fb2f7ea0939a99a03c34f
@@ -9,6 +9,7 @@ module ExAequo
9
9
  actual = blk ? instance_eval(&blk) : subject
10
10
  expect(actual).to eq(value)
11
11
  end
12
+ alias_method :it_equals, :it_eq
12
13
 
13
14
  def it_is(predicate, *args, &blk)
14
15
  actual = blk ? instance_eval(&blk) : subject
@@ -19,6 +20,11 @@ module ExAequo
19
20
  actual = blk ? instance_eval(&blk) : subject
20
21
  expect(actual).not_to send("be_#{predicate}", *args)
21
22
  end
23
+
24
+ def it_raises(exception, message=nil, &blk)
25
+ expect { blk ? instance_eval(&blk) : subject }
26
+ .to raise_error(exception, message)
27
+ end
22
28
  end
23
29
  end
24
30
  end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'securerandom'
4
+ module ExAequo
5
+ module RSpex
6
+ module Macros
7
+ module LetMacros
8
+
9
+ def let_alphanumeric_random(name, length: 16)
10
+ let(name) { SecureRandom.alphanumeric(length) }
11
+ end
12
+
13
+ def let_double(name, type)
14
+ let(name) { double(type) }
15
+ end
16
+
17
+ end
18
+ end
19
+ end
20
+ end
21
+
22
+ RSpec.configure do |conf|
23
+ conf.extend ExAequo::RSpex::Macros::LetMacros
24
+ end
25
+ # SPDX-License-Identifier: AGPL-3.0-or-later
@@ -10,6 +10,7 @@ module ExAequo
10
10
  it_eq(value, &blk)
11
11
  end
12
12
  end
13
+ alias_method :it_equals, :it_eq
13
14
 
14
15
  def it_is(predicate, *args, &blk)
15
16
  specify do
@@ -22,6 +23,12 @@ module ExAequo
22
23
  it_is_not(predicate, *args, &blk)
23
24
  end
24
25
  end
26
+
27
+ def it_raises(exception, message=nil, &blk)
28
+ specify do
29
+ it_raises(exception, message, &blk)
30
+ end
31
+ end
25
32
  end
26
33
  end
27
34
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative 'macros/let_macros'
3
4
  require_relative 'macros/subject_macros'
4
5
  # SPDX-License-Identifier: AGPL-3.0-or-later
@@ -2,7 +2,7 @@
2
2
 
3
3
  module ExAequo
4
4
  module RSpex
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.1'
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.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Dober
@@ -35,6 +35,7 @@ files:
35
35
  - lib/ex_aequo/rspex/helpers.rb
36
36
  - lib/ex_aequo/rspex/helpers/subject_helpers.rb
37
37
  - lib/ex_aequo/rspex/macros.rb
38
+ - lib/ex_aequo/rspex/macros/let_macros.rb
38
39
  - lib/ex_aequo/rspex/macros/subject_macros.rb
39
40
  - lib/ex_aequo/rspex/version.rb
40
41
  homepage: https://codeberg.org/lab419/rb_ex_aequo_rspex