Sha256: ecaf67531e4b51d31e49ac72bb617e14709d8bf148cd8decf353691a1c11b076

Contents?: true

Size: 868 Bytes

Versions: 11

Compression:

Stored size: 868 Bytes

Contents

When(/^I ask (DeepHash|Menu) for (metrics|menu)$/) do |lookup_service, method|
  @enriched_hash = Object.const_get(lookup_service.classify).new.send(method)
end

Then(/^I should see the following "([^"]*)" be injected into the hash at "([^"]*)"$/) do |target, json_path, table|
  expected_names = table.hashes.collect { |row| row[:value] }
  actual_names = JsonPath.new("#{json_path}.#{target.parameterize.underscore.singularize}").on(@enriched_hash.with_indifferent_access)
  expect(actual_names.size).to eq(1)
  expect(actual_names.first).to eq(expected_names)
end

Then(/^I should see the following "([^"]*)" enriched for each sub hash at "([^"]*)"$/) do |name, jsonpath, table|
  expect(JsonPath.new(jsonpath).on(@enriched_hash.with_indifferent_access).first.collect { |i| i[name.parameterize.underscore.to_sym] }).to eq(table.hashes.collect { |i| i[:value] })
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
looksist-0.2.8 features/step_definitions/hash_lookup_steps.rb
looksist-0.2.7 features/step_definitions/hash_lookup_steps.rb
looksist-0.2.6 features/step_definitions/hash_lookup_steps.rb
looksist-0.2.5 features/step_definitions/hash_lookup_steps.rb
looksist-0.2.4 features/step_definitions/hash_lookup_steps.rb
looksist-0.2.3 features/step_definitions/hash_lookup_steps.rb
looksist-0.2.2 features/step_definitions/hash_lookup_steps.rb
looksist-0.2.1 features/step_definitions/hash_lookup_steps.rb
looksist-0.2.0 features/step_definitions/hash_lookup_steps.rb
looksist-0.1.9 features/step_definitions/hash_lookup_steps.rb
looksist-0.1.8 features/step_definitions/hash_lookup_steps.rb