producer-core 0.3.3 → 0.3.4

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: 48c7af413fbd8bac4796f6789db5e1fe2ebc1717
4
- data.tar.gz: 41c1543b1d8c4f7e529191a91c974a18d660e488
3
+ metadata.gz: c3bdbb4562dc3fe33ca9a8c061fe3f66024e62d3
4
+ data.tar.gz: e2c52ab359c244621fe8cd2e84aeb1dbbab4f282
5
5
  SHA512:
6
- metadata.gz: d8d9d8a3b36801b7fe46f4655bdf3eab4a61bcd090ba40806911463ae704d4a8fd7a01951fb18545ab82913d63c71dd1ecb5151cad63880d0f9c145f0ba6372c
7
- data.tar.gz: f52db474d584f3c6f23e7f6f9cbc88d21e400515ba624d092862190146d33bc062eb791637fb6105d8fb5e25d6bfb3282e510f57b582a529f3bb2df0ec6261f8
6
+ metadata.gz: cf04f1f9375497ec688db6bf0e74ace0b7d678805b32d14a20bb92bd743bbeab2e470f5f06052761c958c7d80326b71cca338a8a21abca457f33764549d2aef5
7
+ data.tar.gz: e561bf5bdc15b4f3603c2c3a1e6f4c51d68063b564ec937738c9980cc96f0ac40e5aeff4e58de9c182038bd2a606515028c9becc3dab849b0db4e6c5919cdb75
@@ -24,3 +24,13 @@ Feature: key/value registry
24
24
  """
25
25
  When I successfully execute the recipe
26
26
  Then the output must contain "some_value"
27
+
28
+ Scenario: `get' keyword fetches a value from a condition
29
+ Given a recipe with:
30
+ """
31
+ set :some_key, 'some_value'
32
+
33
+ task(:ok) { condition { get :some_key }; echo get :some_key }
34
+ """
35
+ When I successfully execute the recipe
36
+ Then the output must contain "some_value"
@@ -29,6 +29,9 @@ module Producer
29
29
  end
30
30
  end
31
31
 
32
+ extend Forwardable
33
+ def_delegators :@env, :get
34
+
32
35
  define_test :`, Tests::ShellCommandStatus
33
36
  define_test :sh, Tests::ShellCommandStatus
34
37
  define_test :file_contains, Tests::FileContains
@@ -20,6 +20,7 @@ module Producer
20
20
  def [](key)
21
21
  @registry[key]
22
22
  end
23
+ alias get []
23
24
 
24
25
  def []=(key, value)
25
26
  @registry[key] = value
@@ -1,5 +1,5 @@
1
1
  module Producer
2
2
  module Core
3
- VERSION = '0.3.3'.freeze
3
+ VERSION = '0.3.4'.freeze
4
4
  end
5
5
  end
@@ -173,5 +173,14 @@ module Producer::Core
173
173
  end
174
174
  end
175
175
  end
176
+
177
+ describe '#get' do
178
+ let(:env) { Env.new }
179
+
180
+ it 'delegates to env registry' do
181
+ expect(env).to receive(:get).with :some_key
182
+ described_class.evaluate(env, []) { get :some_key }
183
+ end
184
+ end
176
185
  end
177
186
  end
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.3.3
4
+ version: 0.3.4
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-09-24 00:00:00.000000000 Z
11
+ date: 2014-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh