gurke 3.2.0 → 3.2.1

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: 0dfc9f938d485d50f5e8ac6f3d7c978b2cb9266f478bf8a8e1a29d186e043164
4
- data.tar.gz: 27ef19f2031a73e0cf4105b69587ee088f3bb17f8f74305dc2b5dad09e282d44
3
+ metadata.gz: a55c7c35ab8e49695cc611ce5bbe99396a1acc2d63593f9885fdf7e29fab0793
4
+ data.tar.gz: bc6190dda886605afc557eb3ff8646504f41df28b891750e0d5d1a1ef9b8d690
5
5
  SHA512:
6
- metadata.gz: 49a9f970050511d4946669c040dc37ba2d303a76184518a34ec7ecc74e2f129bbbff321e15bf167220cc4ec3542d13a4051fa95fa2bc3db74d8fc229b5a3fdf1
7
- data.tar.gz: b46d5a895d606a0b772f96cd293ef27f2d62529516ffa5950036682eacb45882a3374bed01f4af41fd6d132386d1e6b8d69c53c715c3fd2f7c33fb388683eedf
6
+ metadata.gz: feabf5c0b0df9ac47eea8258769e806410dea9aedf2102d1448806e6e3f2ec469bb0abe45746cc215721f1a0794193261f6177a29f3ae223960b75e8c0ef74c8
7
+ data.tar.gz: 7b9bb6cd06febd0fb1159a833b1e68a3b5a777f26d4105983f5cc9a7058f77a41e6b1503d5474b5726e6131e2f1fccc77599a961465881da299a405667ec0d06
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.2.1
4
+
5
+ * Reset world between retried scenario runs
6
+
3
7
  ## 3.2.0
4
8
 
5
9
  * Add @flaky tag support for retrying flaky scenarios once
@@ -179,6 +179,7 @@ module Gurke
179
179
 
180
180
  def reset!
181
181
  @state = nil
182
+ @world = nil
182
183
  @exception = nil
183
184
  end
184
185
 
@@ -4,7 +4,7 @@ module Gurke
4
4
  module VERSION
5
5
  MAJOR = 3
6
6
  MINOR = 2
7
- PATCH = 0
7
+ PATCH = 1
8
8
  STAGE = nil
9
9
  STRING = [MAJOR, MINOR, PATCH, STAGE].reject(&:nil?).join('.').freeze
10
10
 
@@ -7,6 +7,7 @@ describe Gurke::Scenario do
7
7
  let(:runner) { double 'runner' }
8
8
  let(:feature) { double 'feature' }
9
9
  let(:backgrounds) { double('backgrounds') }
10
+ let(:tags) { [] }
10
11
 
11
12
  before do
12
13
  allow(feature).to receive(:backgrounds).and_return(backgrounds)
@@ -15,7 +16,7 @@ describe Gurke::Scenario do
15
16
  end
16
17
 
17
18
  let(:scenario) do
18
- Gurke::Scenario.new(feature, nil, nil, nil, nil)
19
+ Gurke::Scenario.new(feature, nil, nil, tags, nil)
19
20
  end
20
21
 
21
22
  describe '#run' do
@@ -49,5 +50,35 @@ describe Gurke::Scenario do
49
50
  expect(@scopes).to eq %i[before_scenario start_scenario
50
51
  end_scenario after_scenario]
51
52
  end
53
+
54
+ context 'with retry' do
55
+ let(:step) { double('step') }
56
+ let(:tags) { [tag] }
57
+ let(:tag) { double('tag') }
58
+ let(:worlds) { Set.new }
59
+
60
+ before { scenario.steps << step }
61
+
62
+ before do
63
+ allow(tag).to receive(:name).and_return('flaky')
64
+ end
65
+
66
+ it 'resets the world' do
67
+ expect(step).to receive(:run) do |_, _, scenario, world|
68
+ worlds << world
69
+ scenario.failed!
70
+ end
71
+
72
+ expect(step).to receive(:run) do |_, _, scenario, world|
73
+ worlds << world
74
+ scenario.passed!
75
+ end
76
+
77
+ subject
78
+
79
+ # Expect to have two *different* worlds collected
80
+ expect(worlds.size).to eq 2
81
+ end
82
+ end
52
83
  end
53
84
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gurke
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Graichen
@@ -142,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  version: '0'
143
143
  requirements: []
144
144
  rubyforge_project:
145
- rubygems_version: 2.7.3
145
+ rubygems_version: 2.7.6
146
146
  signing_key:
147
147
  specification_version: 4
148
148
  summary: An alternative gherkin feature runner inspired by rspec and turnip.