Sha256: 475e461d20cf2a9fd738d3d562999c768c0c583e5ebf3ee4fe02efbd601efaec
Contents?: true
Size: 1.25 KB
Versions: 2
Compression:
Stored size: 1.25 KB
Contents
module Pickles class << self def configure yield config end def config @_configuration ||= Pickles::Config.new end end end class Pickles::Config using HashStringifyKeys attr_accessor :css_node_map, :xpath_node_map, :log_xhr_response def initialize @css_node_map = {} @log_xhr_response = false @xpath_node_map = {} @fill_tag_steps_map = { 'select' => FillIN::Select, 'jselect' => FillIN::JsSelect } @check_tag_steps_map = { 'text' => CheckIn::Text } end def css_node_map=(map) raise(ArgumentError, "Node map must be a hash") unless map.is_a?(Hash) @css_node_map = map.stringify_keys end def xpath_node_map=(map) raise(ArgumentError, "Node map must be a hash") unless map.is_a?(Hash) @xpath_node_map = map.stringify_keys end def fill_tag_steps_map=(map) raise(ArgumentError, "Node map must be a hash") unless map.is_a?(Hash) @fill_tag_steps_map.merge!(map.stringify_keys) end def check_tag_steps_map=(map) raise(ArgumentError, "Node map must be a hash") unless map.is_a?(Hash) @check_tag_steps_map.merge!(map.stringify_keys) end def step_by_tag(tag) @fill_tag_steps_map[tag] end def check_step_by_tag(tag) @check_tag_steps_map[tag] end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
pickles-0.2.1 | lib/cucumber/pickles/config.rb |
pickles-0.2.0 | lib/cucumber/pickles/config.rb |