producer-core 0.5.1 → 0.5.2

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
  SHA1:
3
- metadata.gz: 04b7ee0907fecaabb24d2afa0bc804177f4ed590
4
- data.tar.gz: 160b4b18e193932746bb28fe38c8ccc06d3b2e74
3
+ metadata.gz: ce3292de80f4a5ad11ba230b7d608ba0c6f93a0a
4
+ data.tar.gz: a99e00821bbd050d312f0c2fc55296b5ebe7bdb0
5
5
  SHA512:
6
- metadata.gz: 0a05eb5d9016a9b135e066a1d64b68f59b887575e68aacedbd2a89a72534c96f69f02019ae4f71851ff70dcf91429c3bde92250e473e52dbfb3324ce852c4bec
7
- data.tar.gz: 3902892361957a8fa9fc7498cb4ee1ce5142a33a865e01fdcaf2f74d2e2b788a5fc95f58370c3ec9ca38c0ab50d3447be818bff1d3fb69060e05c676114482ce
6
+ metadata.gz: e4a4bbc92388b63b098211fb5e317fdb54288137f519842c106c7a76a6a16323d1509c28450a065f84822145f2308c3877139b80baf5e82e3d30841d668644de
7
+ data.tar.gz: 406357ca9a0cd97e3b1367c2ce059046811903127d62cccfd223edba2f6719b60d0a1d8e9272927a5718d2bca11b5c582cd2c9d095a163bbb9b0698e7831102c
@@ -13,7 +13,7 @@ Feature: `mkdir' task action
13
13
 
14
14
  Scenario: creates directory given as argument
15
15
  When I successfully execute the recipe on remote target
16
- Then the remote directory "some_directory" must exists
16
+ Then the remote directory "some_directory" must exist
17
17
 
18
18
  Scenario: creates directory with given attributes
19
19
  When I successfully execute the recipe on remote target
@@ -28,4 +28,4 @@ Feature: `mkdir' task action
28
28
  end
29
29
  """
30
30
  When I successfully execute the recipe on remote target
31
- Then the remote directory "some/directory" must exists
31
+ Then the remote directory "some/directory" must exist
@@ -1,51 +1 @@
1
- require 'aruba/cucumber'
2
- require 'aruba/in_process'
3
- require 'producer/core'
4
-
5
- class ArubaProgramWrapper
6
- def initialize(argv, stdin = $stdin, stdout = $stdout, stderr = $stderr,
7
- kernel = Kernel)
8
- @argv = argv
9
- @stdin = stdin
10
- @stdout = stdout
11
- @stderr = stderr
12
- @kernel = kernel
13
- end
14
-
15
- def execute!
16
- Producer::Core::CLI.run!(
17
- @argv.dup, stdin: @stdin, stdout: @stdout, stderr: @stderr
18
- )
19
- rescue SystemExit => e
20
- @kernel.exit e.status
21
- end
22
- end
23
-
24
-
25
- # Raise aruba default timeout so test suite can run on a slow machine.
26
- Before do
27
- @aruba_timeout_seconds = 8
28
- end
29
-
30
- # Use aruba "in process" optimization only for scenarios not tagged @exec.
31
- # We need a real process in a few cases: real program name, interactive usage…
32
- Before('@exec') do
33
- Aruba.process = Aruba::SpawnProcess
34
- end
35
-
36
- Before('~@exec') do
37
- Aruba::InProcess.main_class = ArubaProgramWrapper
38
- Aruba.process = Aruba::InProcess
39
- end
40
-
41
- # Fake home directory for @fake_home tagged scenarios.
42
- Before('@fake_home') do
43
- ENV['HOME'] = File.expand_path(current_dir)
44
- end
45
-
46
- # Enable cucumber-sshd "fast" mode (persists sshd across scenarios), and
47
- # register hooks for @sshd tagged scenarios.
48
- Before do
49
- @_sshd_fast = true
50
- end
51
- require 'cucumber/sshd/cucumber'
1
+ require 'producer/core/testing/cucumber'
@@ -0,0 +1,24 @@
1
+ module Producer
2
+ module Core
3
+ module Testing
4
+ class ArubaProgramWrapper
5
+ def initialize(argv, stdin = $stdin, stdout = $stdout, stderr = $stderr,
6
+ kernel = Kernel)
7
+ @argv = argv
8
+ @stdin = stdin
9
+ @stdout = stdout
10
+ @stderr = stderr
11
+ @kernel = kernel
12
+ end
13
+
14
+ def execute!
15
+ Producer::Core::CLI.run!(
16
+ @argv.dup, stdin: @stdin, stdout: @stdout, stderr: @stderr
17
+ )
18
+ rescue SystemExit => e
19
+ @kernel.exit e.status
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -16,7 +16,7 @@ Given /^a remote file named "([^"]+)" with "([^"]+)"$/ do |file_name, content|
16
16
  write_file file_name, content
17
17
  end
18
18
 
19
- Then /^the remote directory "([^"]+)" must exists$/ do |path|
19
+ Then /^the remote directory "([^"]+)" must exist$/ do |path|
20
20
  check_directory_presence [path], true
21
21
  end
22
22
 
@@ -0,0 +1,39 @@
1
+ require 'aruba/cucumber'
2
+ require 'aruba/in_process'
3
+
4
+ require 'producer/core'
5
+ require 'producer/core/testing/aruba_program_wrapper'
6
+ require 'producer/core/testing/cucumber/etc_steps'
7
+ require 'producer/core/testing/cucumber/execution_steps'
8
+ require 'producer/core/testing/cucumber/output_steps'
9
+ require 'producer/core/testing/cucumber/recipe_steps'
10
+ require 'producer/core/testing/cucumber/remote_steps'
11
+ require 'producer/core/testing/cucumber/ssh_steps'
12
+
13
+ # Raise aruba default timeout so test suite can run on a slow machine.
14
+ Before do
15
+ @aruba_timeout_seconds = 8
16
+ end
17
+
18
+ # Use aruba "in process" optimization only for scenarios not tagged @exec.
19
+ # We need a real process in a few cases: real program name, interactive usage…
20
+ Before('@exec') do
21
+ Aruba.process = Aruba::SpawnProcess
22
+ end
23
+
24
+ Before('~@exec') do
25
+ Aruba::InProcess.main_class = Producer::Core::Testing::ArubaProgramWrapper
26
+ Aruba.process = Aruba::InProcess
27
+ end
28
+
29
+ # Fake home directory for @fake_home tagged scenarios.
30
+ Before('@fake_home') do
31
+ ENV['HOME'] = File.expand_path(current_dir)
32
+ end
33
+
34
+ # Enable cucumber-sshd "fast" mode (persists sshd across scenarios), and
35
+ # register hooks for @sshd tagged scenarios.
36
+ Before do
37
+ @_sshd_fast = true
38
+ end
39
+ require 'cucumber/sshd/cucumber'
@@ -1,5 +1,5 @@
1
1
  module Producer
2
2
  module Core
3
- VERSION = '0.5.1'.freeze
3
+ VERSION = '0.5.2'.freeze
4
4
  end
5
5
  end
@@ -47,7 +47,7 @@ module Producer::Core
47
47
  end
48
48
  end
49
49
 
50
- context 'when parent directories does not exists' do
50
+ context 'when parent directories does not exist' do
51
51
  let(:path) { 'some/path' }
52
52
 
53
53
  it 'creates parent directories' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: producer-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thibault Jouan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-04 00:00:00.000000000 Z
11
+ date: 2015-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh
@@ -147,12 +147,6 @@ files:
147
147
  - features/recipe/target.feature
148
148
  - features/recipe/test_macro.feature
149
149
  - features/ssh/config.feature
150
- - features/steps/etc_steps.rb
151
- - features/steps/execution_steps.rb
152
- - features/steps/output_steps.rb
153
- - features/steps/recipe_steps.rb
154
- - features/steps/remote_steps.rb
155
- - features/steps/ssh_steps.rb
156
150
  - features/support/env.rb
157
151
  - features/task/ask.feature
158
152
  - features/task/condition.feature
@@ -194,6 +188,14 @@ files:
194
188
  - lib/producer/core/template.rb
195
189
  - lib/producer/core/test.rb
196
190
  - lib/producer/core/testing.rb
191
+ - lib/producer/core/testing/aruba_program_wrapper.rb
192
+ - lib/producer/core/testing/cucumber.rb
193
+ - lib/producer/core/testing/cucumber/etc_steps.rb
194
+ - lib/producer/core/testing/cucumber/execution_steps.rb
195
+ - lib/producer/core/testing/cucumber/output_steps.rb
196
+ - lib/producer/core/testing/cucumber/recipe_steps.rb
197
+ - lib/producer/core/testing/cucumber/remote_steps.rb
198
+ - lib/producer/core/testing/cucumber/ssh_steps.rb
197
199
  - lib/producer/core/testing/mock_remote.rb
198
200
  - lib/producer/core/tests/condition_test.rb
199
201
  - lib/producer/core/tests/file_contains.rb
@@ -302,12 +304,6 @@ test_files:
302
304
  - features/recipe/target.feature
303
305
  - features/recipe/test_macro.feature
304
306
  - features/ssh/config.feature
305
- - features/steps/etc_steps.rb
306
- - features/steps/execution_steps.rb
307
- - features/steps/output_steps.rb
308
- - features/steps/recipe_steps.rb
309
- - features/steps/remote_steps.rb
310
- - features/steps/ssh_steps.rb
311
307
  - features/support/env.rb
312
308
  - features/task/ask.feature
313
309
  - features/task/condition.feature