gurke 2.0.0.dev.1.b19 → 2.0.0.dev.1.b20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +8 -8
  2. data/spec/gurke/scenario_spec.rb +50 -0
  3. metadata +4 -2
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzAxYTk2ODk0YzgxZWM2OTBkM2QzY2ZkYTIzOWI2NWIyODJmYjE0Zg==
4
+ N2IyOGUyNzJiNTkzNTU2NzJmNjE0ZTMwZTVkOTI2ZTY1ZjMyMDE1YQ==
5
5
  data.tar.gz: !binary |-
6
- YTQ2NWJmMzY0MGE2Y2NjMjRiMWEwMTc5ODhlZGU3Nzg5ZmU5Y2ZjMw==
6
+ MWJhZmU4M2U4ODZmNDYxMDRlMWFhZjgzZDU4Y2NjMGFlNTNjYjgzYQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MmI4ZGViNDEyYmZmZDAzMWI2MDI4ZmE3OTgzODU5MjJhZDMzZDk2Y2I1MjQ0
10
- ZWUxNTUwOWUzNDI2ZjNkM2RkMjMyMmE3NWE5YjE0YjIzMjE0YmIxMjgwM2I2
11
- MzFjZWFjZjllMDhjODEwOGYxMjJmMjcwNWI2Zjk3ZDE2ZmM3NmI=
9
+ Nzc2YzQ3OTlkYTAzNzk2MThlNjU1NGZhZWQ2NDM5ZDM0Y2I3YzM4ODFjODE2
10
+ MTRiYjk0NjQxNzY5Yzk1YWE5YjdjNjVlODFjZWI0MWQ5MmRmMzRmNGUxZjRk
11
+ NWYzN2FjMWMzZDg3NTk4NmQxODlmYjFjZTEyYmQxYjMxMzQzZjQ=
12
12
  data.tar.gz: !binary |-
13
- ZjU2ZDUzYzcxOGMxZTk5YTEzZGRlNmRmNmJmOTE4ODlkYWJmZjc3NmI1YTE2
14
- MDU4MjI2NDYwNjAxNjI0NDgzODM4OWFmYjEzNGFlZmNjODljZDI2Yjc1OTAx
15
- NmQ1M2RlZjliMjBmYjViNThjMDhlYmMwMmU3MGRhZjNkOTIzNjA=
13
+ YjU1ZDI0NzlkM2FjZTllZjkzZjNiYjNkZmY2ZmFlNTQ0NTkwN2M4ZjJmYWY4
14
+ OTFiMWMzYTlhNTE0ZjY4YWQ4MGYwMmMzZGMwOWRlYWFmMWIyNWVjNTY5NjVj
15
+ ZThkNmQzMDMwYzEzYzFmMzQxNGU4MGZlMzkwYzZkYTlhNTEwMzE=
@@ -0,0 +1,50 @@
1
+ require 'spec_helper'
2
+
3
+ describe Gurke::Scenario do
4
+ let(:reporter) { Gurke::Reporters::NullReporter.new }
5
+ let(:runner) { double 'runner' }
6
+ let(:feature) { double 'feature' }
7
+ let(:backgrounds) { double('backgrounds') }
8
+
9
+ before do
10
+ allow(feature).to receive(:backgrounds).ordered.and_return(backgrounds)
11
+ allow(backgrounds).to receive(:run)
12
+ allow(runner).to receive(:hook){|_,_,&block| block.call }
13
+ end
14
+
15
+ let(:scenario) do
16
+ Gurke::Scenario.new(feature, nil, nil, nil, nil)
17
+ end
18
+
19
+ describe '#run' do
20
+ subject { scenario.run(runner, reporter) }
21
+
22
+ it 'runs all backgrounds' do
23
+ expect(backgrounds).to receive(:run)
24
+ .with(runner, reporter, scenario, scenario.send(:world))
25
+
26
+ subject
27
+ end
28
+
29
+ it 'runs hook in scenario world' do
30
+ expect(runner).to receive(:hook) do |scope, world|
31
+ expect(scope).to eq :scenario
32
+ expect(world).to eq scenario.send(:world)
33
+ end
34
+
35
+ subject
36
+ end
37
+
38
+ it 'runs reporter callbacks in correct order' do
39
+ expect(reporter).to receive(:invoke).exactly(4).times do |*args|
40
+ @scopes ||= []
41
+ @scopes << args.first
42
+ end
43
+
44
+ subject
45
+
46
+ expect(@scopes).to eq [:before_scenario, :start_scenario,
47
+ :end_scenario, :after_scenario]
48
+ end
49
+ end
50
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gurke
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.dev.1.b19
4
+ version: 2.0.0.dev.1.b20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Graichen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-31 00:00:00.000000000 Z
11
+ date: 2014-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: trollop
@@ -106,6 +106,7 @@ files:
106
106
  - lib/gurke/steps.rb
107
107
  - lib/gurke/tag.rb
108
108
  - lib/gurke/version.rb
109
+ - spec/gurke/scenario_spec.rb
109
110
  - spec/spec_helper.rb
110
111
  homepage: https://github.com/jgraichen/gurke
111
112
  licenses:
@@ -139,4 +140,5 @@ test_files:
139
140
  - features/gurke/step_specific_definitions.feature
140
141
  - features/support/steps/cli_steps.rb
141
142
  - features/support/steps/file_steps.rb
143
+ - spec/gurke/scenario_spec.rb
142
144
  - spec/spec_helper.rb