allure_turnip 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/allure_turnip/dsl.rb +25 -19
- data/lib/allure_turnip/version.rb +1 -1
- data/spec/step_calling.feature +3 -0
- data/spec/steps/step_calling_steps.rb +9 -0
- data/spec/steps_for_super.feature +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62ad1e5048e18e54eda488dc29bc1e411f2896cb1c9b2ebe7b03a0e56c0b88a9
|
4
|
+
data.tar.gz: 449e4fb87d84b38cd5ca6be05f5e38fe518f895434b3ceaf0f88385acd97af41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e182a3501609fd91081baa475f006524b03bb58d8d86e9dc661932574aec37527f5b2d0839d7e396259e83fce151680ccbe43e3ec0a42f68759345248ff21a88
|
7
|
+
data.tar.gz: 8b6e43680e155cf5f500284d6fe9c31cc058bfda21ea361b25fabaccccd1683a9153a5c4354b96273d1592fd87dc90dce3fa568dcf994cfba286ee5546acf6c3
|
data/Gemfile.lock
CHANGED
data/lib/allure_turnip/dsl.rb
CHANGED
@@ -15,12 +15,18 @@ module AllureTurnip
|
|
15
15
|
|
16
16
|
def allure_step(step, &block)
|
17
17
|
begin
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
18
|
+
locked = __mutex.try_lock
|
19
|
+
if locked
|
20
|
+
@@__current_step = step
|
21
|
+
__with_allure_step(step, &block)
|
22
|
+
else
|
23
|
+
__with_step(step,&block)
|
24
|
+
end
|
25
|
+
ensure
|
26
|
+
if locked
|
27
|
+
@@__current_step = nil
|
28
|
+
__mutex.unlock
|
29
|
+
end
|
24
30
|
end
|
25
31
|
end
|
26
32
|
|
@@ -51,22 +57,22 @@ module AllureTurnip
|
|
51
57
|
@@__mutex ||= Mutex.new
|
52
58
|
end
|
53
59
|
|
54
|
-
def
|
60
|
+
def __with_allure_step(step, &block)
|
55
61
|
begin
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
ensure
|
63
|
-
if locked
|
64
|
-
AllureTurnip.context.rspec.hooks.send :run, :after, :step, self
|
65
|
-
@@__current_step = nil
|
66
|
-
__mutex.unlock
|
67
|
-
end
|
62
|
+
AllureRubyAdaptorApi::Builder.start_step(__suite, __test, step)
|
63
|
+
__with_step(step, &block)
|
64
|
+
AllureRubyAdaptorApi::Builder.stop_step(__suite, __test, step)
|
65
|
+
rescue Exception => e
|
66
|
+
AllureRubyAdaptorApi::Builder.stop_step(__suite, __test, step, :failed)
|
67
|
+
raise e
|
68
68
|
end
|
69
69
|
end
|
70
|
+
|
71
|
+
def __with_step(step, &block)
|
72
|
+
AllureTurnip.context.rspec.hooks.send :run, :before, :step, self
|
73
|
+
yield self
|
74
|
+
AllureTurnip.context.rspec.hooks.send :run, :after, :step, self
|
75
|
+
end
|
70
76
|
end
|
71
77
|
end
|
72
78
|
end
|
data/spec/step_calling.feature
CHANGED
@@ -5,6 +5,9 @@ Feature: Step-calling steps
|
|
5
5
|
Scenario: when the called step is visible
|
6
6
|
Given a visible step call
|
7
7
|
|
8
|
+
Scenario: when the called failed step is visible, this test should fail
|
9
|
+
Given a visible failed step call
|
10
|
+
|
8
11
|
Scenario: when the called step is not visible
|
9
12
|
Given an invisible step call
|
10
13
|
|
@@ -8,6 +8,15 @@ steps_for :step_calling do
|
|
8
8
|
@testing.should eq(123)
|
9
9
|
end
|
10
10
|
|
11
|
+
step 'visible failed callee' do
|
12
|
+
@testing = 123
|
13
|
+
@testing.should eq(321)
|
14
|
+
end
|
15
|
+
|
16
|
+
step 'a visible failed step call' do
|
17
|
+
step 'visible failed callee'
|
18
|
+
end
|
19
|
+
|
11
20
|
step 'an invisible step call' do
|
12
21
|
step 'this is an unimplemented step'
|
13
22
|
end
|
@@ -1,14 +1,14 @@
|
|
1
1
|
Feature: Red Dragons are deadly
|
2
2
|
|
3
3
|
@dragon
|
4
|
-
Scenario:
|
4
|
+
Scenario: Not red dragon
|
5
5
|
Given there is a dragon
|
6
6
|
And there is a knight
|
7
7
|
When the dragon attacks the knight
|
8
8
|
Then the knight is alive
|
9
9
|
|
10
10
|
@red_dragon
|
11
|
-
Scenario:
|
11
|
+
Scenario: red dragon
|
12
12
|
Given there is a dragon
|
13
13
|
And the dragon breathes fire
|
14
14
|
And there is a knight
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: allure_turnip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aha-oretama
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -158,5 +158,5 @@ requirements: []
|
|
158
158
|
rubygems_version: 3.0.2
|
159
159
|
signing_key:
|
160
160
|
specification_version: 4
|
161
|
-
summary: allure_turnip-0.2.
|
161
|
+
summary: allure_turnip-0.2.1
|
162
162
|
test_files: []
|