lib/cucumber/pickles/steps/fill_in/factory.rb in pickles-0.1.8 vs lib/cucumber/pickles/steps/fill_in/factory.rb in pickles-0.1.9
- old
+ new
@@ -7,19 +7,34 @@
@value = value
@within = within
end
def call
- if !@value.nil? && @value[':']
+ if in_quotes?
+ remove_quotes!
+ end
+
+ if !@value.nil? && @value[':'] && !in_quotes?
step = FillIN::ComplexInput
elsif @label =~ TAG
@label = $1
tag = $2
step = Pickles.config.step_by_tag(tag) || FillIN::Input
else
step = FillIN::Input
end
step.new(@label, @value, @within)
+ end
+
+private
+
+ def in_quotes?
+ @in_quotes ||= @value && @value[0] == "\"" && @value[-1] == "\""
+ end
+
+ def remove_quotes!
+ @value[0] = ''
+ @value[-1] = ''
end
end