rspec-parameterized-context 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b3c603d4e42f9ed89ed4ae2cd15ff275b90946e1f6baa535e71323677913960e
4
- data.tar.gz: 7ec7d5613024ffa5956d305c1f79b98f42045d5612af6913182b5b244373fa56
3
+ metadata.gz: d42a813368042acc01a3600bb0b8f14fa2af5296f1c379dd232478aa2ff47e64
4
+ data.tar.gz: 1e80b17977bfaa0084f571e637f47b6afee55e8ed6a8b80b872501009cb4db09
5
5
  SHA512:
6
- metadata.gz: 5913536b2e81bff61dedea80c848002c1e978e8cb33f7106856e3db8c395e198e555ba12c0c5a5b43d432296bac9cb4707199a08bb40d6d8f18a559f815d5762
7
- data.tar.gz: 73cea398ebc85de08b2a4c3ec7fdf6c543f218ee3583a7bd3c0c52dd0f4a09a31227e2dfc6ed5e3cfe6dfbc75cd713fee33038fac1e29f84be3e14c736583193
6
+ metadata.gz: a77ae5d2d0b76442c06ae6ecafa3f96978047f0ad2aa8298c9d2635352bfb889d4713f511ac80af8afda1d7a13a54dcf4f1b2ca08748857771f9c0ceb1cfe35e
7
+ data.tar.gz: 7ecb77b7ed03a99508d1ad4c8a1f3a3324a5de1d896760ea13cbb396802096831fcacdf7ff8f6aa45b50452efabce925f479a51e2ee1ee8252ab433b48172a2e
data/README.md CHANGED
@@ -50,7 +50,7 @@ end
50
50
 
51
51
  ### Feature
52
52
 
53
- rspec-parameterized-context supports to evaluate block that given where method in transaction.
53
+ - rspec-parameterized-context supports to evaluate block that given where method in transaction.
54
54
 
55
55
  ```ruby
56
56
  # Assume today is 2020/9/9
@@ -76,6 +76,27 @@ describe 'Evaluting block that given to where in transaction' do
76
76
  end
77
77
  ```
78
78
 
79
+ - You can run specific context by focus_index parameter
80
+
81
+ ```ruby
82
+ describe "Addition" do
83
+ parameterized do
84
+ where(:a, :b, :answer, size: 3, focus_index: 1) do
85
+ [
86
+ [1 , 2 , 3],
87
+ [5 , 8 , 13], # will run only this context
88
+ [0 , 0 , 0]
89
+ ]
90
+ end
91
+
92
+ with_them do
93
+ it do
94
+ expect(a + b).to eq answer
95
+ end
96
+ end
97
+ end
98
+ end
99
+ ```
79
100
 
80
101
  ## Contributing
81
102
 
@@ -14,6 +14,7 @@ module RSpecParameterizedContext
14
14
  def where(*names, size:, focus_index: nil, &block)
15
15
  @where_names = names
16
16
  @where_size = size
17
+ @where_focus_index = focus_index
17
18
  @where_block = block
18
19
  end
19
20
 
@@ -28,9 +29,12 @@ module RSpecParameterizedContext
28
29
  where_block = @where_block
29
30
  where_names = @where_names
30
31
  where_size = @where_size
32
+ where_focus_index = @where_focus_index
31
33
  with_them_block = @with_them_block
32
34
 
33
35
  where_size.times do |index|
36
+ next if where_focus_index && index != where_focus_index
37
+
34
38
  @rspec_context.context("parameterized phase ##{index}") do
35
39
  let(:_parameters) do
36
40
  instance_exec(&where_block)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RspecParameterizedContext
4
- VERSION = '0.0.3'
4
+ VERSION = '0.1.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-parameterized-context
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - alpaca-tc
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-09-14 00:00:00.000000000 Z
12
+ date: 2020-09-28 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: ''
15
15
  email: