producer-core 0.2.7 → 0.2.8

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
  SHA1:
3
- metadata.gz: 558adf1eb44b9065788d910cc92c133894612fd1
4
- data.tar.gz: 97b0bbc77826a98b81e854f2a7034ff8ca544557
3
+ metadata.gz: e4762ed57bd74293a1017f2ca3410b27642eae90
4
+ data.tar.gz: ad1cd8fa2f52b877951503497c5207eb8a39c92e
5
5
  SHA512:
6
- metadata.gz: 6d4ffe253ba82de174a3064bc015e188c4d6e1715705cf211a03708695980daf66b3a6299973757fad6d236ab06a48e457d89db694682e9535f4533b6ad312aa
7
- data.tar.gz: a5402e095dd72ba88a69ec602d99eb137c7a5821c3adecf95657a3c4e340231be42be593d84bee7307c217e723905d9cf6df57b07e9fe38a5a0af3d63643aaad
6
+ metadata.gz: f3b81d877cf394644a533673c78f11078446c0f2392178e258e3496eb9a9d29420b017c26efde01250f4f924ecff163a75e9bf92b92f04828c2dba70f3705e6a
7
+ data.tar.gz: 02368fc9778bded5100a90a28e1e6ec3bebc1941db706581151d829d6042e9e7ff3a1cd1fea343b0aaed73237d7e58f6e173cbff8a4b25a24a418186fd1a14c8
@@ -6,5 +6,5 @@ Feature: CLI usage
6
6
  Then the exit status must be 64
7
7
  And the output must contain exactly:
8
8
  """
9
- Usage: producer [-v] [-n] recipe_file
9
+ Usage: producer [-v] [-n] [-t host.example] recipe_file
10
10
  """
@@ -6,7 +6,7 @@ Feature: CLI verbose option
6
6
  task :task_ok do
7
7
  condition { true }
8
8
 
9
- echo 'some mesasge'
9
+ echo 'some message'
10
10
  end
11
11
 
12
12
  task :task_ko do
@@ -16,16 +16,18 @@ Feature: CLI verbose option
16
16
 
17
17
  Scenario: prints tasks name
18
18
  When I successfully execute the recipe with option -v
19
- Then the output must match /Task:.+task_ok/
19
+ Then the output must match /^Task:.+`task_ok'/
20
+ And the output must match /^Task:.+`task_ko'/
20
21
 
21
- Scenario: prints whether condition is met
22
+ Scenario: appends `applying' or `skipped' after tasks name
22
23
  When I successfully execute the recipe with option -v
23
- Then the output must match /task_ok.+ condition: met.*task_ko.* condition: NOT met/
24
+ Then the output must match /task_ok.+applying...$/
25
+ And the output must match /task_ko.+skipped$/
24
26
 
25
27
  Scenario: prints actions info
26
28
  When I successfully execute the recipe with option -v
27
- Then the output must match /task_ok.+ action: echo/
29
+ Then the output must match /^ action: echo/
28
30
 
29
31
  Scenario: formats message with our simple logger
30
32
  When I successfully execute the recipe with option -v
31
- Then the output must match /\ATask:.+task_ok.*\n.*condition/
33
+ Then the output must match /\ATask:/
@@ -3,7 +3,8 @@ module Producer
3
3
  class CLI
4
4
  ArgumentError = Class.new(::ArgumentError)
5
5
 
6
- USAGE = "Usage: #{File.basename $0} [-v] [-n] recipe_file".freeze
6
+ OPTIONS_USAGE = '[-v] [-n] [-t host.example]'.freeze
7
+ USAGE = "Usage: #{File.basename $0} #{OPTIONS_USAGE} recipe_file".freeze
7
8
 
8
9
  EX_USAGE = 64
9
10
  EX_SOFTWARE = 70
@@ -1,5 +1,5 @@
1
1
  module Producer
2
2
  module Core
3
- VERSION = '0.2.7'.freeze
3
+ VERSION = '0.2.8'.freeze
4
4
  end
5
5
  end
@@ -12,15 +12,14 @@ module Producer
12
12
  end
13
13
 
14
14
  def process_task(task)
15
- env.log "Task: #{task} applying"
16
15
  if task.condition_met?
17
- env.log ' condition: met'
16
+ env.log "Task: `#{task}' applying..."
18
17
  task.actions.each do |e|
19
18
  env.log " action: #{e} applying"
20
19
  e.apply unless env.dry_run?
21
20
  end
22
21
  else
23
- env.log ' condition: NOT met'
22
+ env.log "Task: `#{task}' skipped"
24
23
  end
25
24
  end
26
25
  end
@@ -18,7 +18,7 @@ module Producer::Core
18
18
  let(:task) { Task.new(task_name, [action]) }
19
19
 
20
20
  it 'logs task info' do
21
- expect(env).to receive(:log).with /\ATask: #{task_name}/
21
+ expect(env).to receive(:log).with /\ATask: `#{task_name}'/
22
22
  worker.process_task task
23
23
  end
24
24
 
@@ -28,8 +28,8 @@ module Producer::Core
28
28
  worker.process_task task
29
29
  end
30
30
 
31
- it 'logs condition info' do
32
- expect(env).to receive(:log).with(' condition: met')
31
+ it 'logs the task as beeing applied' do
32
+ expect(env).to receive(:log).with /#{task_name}.+applying\.\.\.\z/
33
33
  worker.process_task task
34
34
  end
35
35
 
@@ -56,8 +56,8 @@ module Producer::Core
56
56
  worker.process_task task
57
57
  end
58
58
 
59
- it 'logs condition info' do
60
- expect(env).to receive(:log).with(' condition: NOT met')
59
+ it 'logs the task as beeing skipped' do
60
+ expect(env).to receive(:log).with /#{task_name}.+skipped\z/
61
61
  worker.process_task task
62
62
  end
63
63
  end
@@ -28,7 +28,7 @@ module TestEnvHelpers
28
28
  end
29
29
 
30
30
  def build_remote
31
- fs = RSpec::Mocks::Mock.new('remote fs', __declared_as: 'Double')
31
+ fs = RSpec::Mocks::Double.new('remote fs')
32
32
  remote = Producer::Core::Testing::MockRemote.new('some_host.test')
33
33
  remote.define_singleton_method(:fs) { fs }
34
34
  remote
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.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thibault Jouan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-27 00:00:00.000000000 Z
11
+ date: 2015-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh
@@ -251,7 +251,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
251
251
  version: '0'
252
252
  requirements: []
253
253
  rubyforge_project:
254
- rubygems_version: 2.2.2
254
+ rubygems_version: 2.4.5
255
255
  signing_key:
256
256
  specification_version: 4
257
257
  summary: Provisioning tool