Sha256: ff62d6a3bda1d79929e0dfe3c47bdd4e4c5c94ba785f1d927145c2cc84c77913
Contents?: true
Size: 1.02 KB
Versions: 39
Compression:
Stored size: 1.02 KB
Contents
require 'json' Given /^a hash map with the form (.*)$/ do |hash| @hash = JSON.parse(hash) end Given /^a path array (.*)$/ do |path| @path = JSON.parse(path) end Given /^a value (.*)$/ do |value| @value = value end When /^I call the deep_get method$/ do @deep_get_value = RightSupport::Data::HashTools.deep_get(@hash, @path) end When /^I call the deep_set! method$/ do RightSupport::Data::HashTools.deep_set!(@hash, @path, @value) end When /^I call the deep_merge! method with the source: (.*)$/ do |source| RightSupport::Data::HashTools.deep_merge!(@hash, JSON.parse(source)) end When /^I call the deep_remove! method with the source: (.*)$/ do |source| RightSupport::Data::HashTools.deep_remove!(@hash, JSON.parse(source)) end Then /^The hash should be: (.*)$/ do |hash| @hash == JSON.parse(hash) end Then /^The deep_get method response should be: (.*)$/ do |expression| @deep_get_value == expression end Then /^The generate method response should be: (.*)$/ do |expression| @generated_value == expression end
Version data entries
39 entries across 39 versions & 1 rubygems