helpstation 0.1.3 → 0.1.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: 10735e8d1c1287a67743aa8ebd1de5f608c93b34
4
- data.tar.gz: c0e14bde4ea1682df121875a03a81b5192817bb4
3
+ metadata.gz: 81341cf8e7e321080c55620575ae4a25cb076ab3
4
+ data.tar.gz: ae67dc37c863c5c771bd67caf5b95e857c573477
5
5
  SHA512:
6
- metadata.gz: ff51affc696814a260b1891684c229b29a54883f436b2ef594bb666777da66214f119adbbd759a4ab690c605404a89bcc70ad6b077fbd575d6f2b03ef9e9652b
7
- data.tar.gz: 2e781d26a9cae27144de68e02cc6aa0677f12094e73f73b425f381135bc2cbf0378571386d3df51f10543ba79600acc3b5e93695421a7ff78182cc81d9dd121d
6
+ metadata.gz: 804aa898d1b18fc6e9fc78d9e9e481318c44afe73ed7123f141fe5cb72d49d6896d0a108b24e2e3739e263218ef614b4372120c5cbd5ff5e377d87709f2cd734
7
+ data.tar.gz: 9879d023e41c03661a79aee77727da624dc77036185bb87d7ef65fa8952ddc2c5831986dd5b0536f4b0e87a7fdbecc523fc199edb207c494aa10b80349370d4a
@@ -12,7 +12,7 @@ module Helpstation
12
12
  output_key
13
13
  end
14
14
  define_method :fetch do |input_value|
15
- block.call input_value
15
+ block.call input_value, env
16
16
  end
17
17
  end
18
18
  end
@@ -1,3 +1,3 @@
1
1
  module Helpstation
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
@@ -4,11 +4,13 @@ describe Helpstation::Fetchers::ByKeyFetcher do
4
4
  subject { processor.call request }
5
5
 
6
6
  let(:processor) {
7
- described_class.build(input_key, output_key) do
8
- output
7
+ described_class.build(input_key, output_key) do |key, env|
8
+ "#{key} and #{env}"
9
9
  end
10
10
  }
11
11
 
12
+ let(:env) { { mock_service: :mock_value } }
13
+
12
14
  let(:input_key) { :my_input }
13
15
  let(:output_key) { :my_output }
14
16
  let(:output) { "putting out" }
@@ -16,13 +18,13 @@ describe Helpstation::Fetchers::ByKeyFetcher do
16
18
  let(:request) { Substation::Request.new('my_request', env, input) }
17
19
 
18
20
  context 'when input_key is present' do
19
- let(:input) { { my_input: 'test' } }
21
+ let(:input) { { my_input: 'input_key' } }
20
22
 
21
23
  it 'returns correct output' do
22
24
  expect(subject).to be_a(Substation::Response::Success)
23
25
  expect(subject.output).to eq(
24
26
  my_input: input[:my_input],
25
- my_output: output
27
+ my_output: "input_key and {:mock_service=>:mock_value}"
26
28
  )
27
29
  end
28
30
  end
data/spec/spec_helper.rb CHANGED
@@ -11,8 +11,4 @@ RSpec.configure do |config|
11
11
  config.run_all_when_everything_filtered = true
12
12
  config.filter_run :focus
13
13
  config.order = 'random'
14
-
15
- def env(opts={})
16
- @_env ||= {}
17
- end
18
14
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: helpstation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Indrek Juhkam