Skip to content

Commit c0f2e07

Browse files
committed
Update the JSON type Cucumber step, delegating type-to-class conversion to the matcher
1 parent 6ff6acd commit c0f2e07

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/json_spec/cucumber.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,10 @@
7979
end
8080

8181
Then /^the (?:JSON|json)(?: response)?(?: at "(.*)")? should( not)? be an? (.*)$/ do |path, negative, type|
82-
klass = Module.const_get(type.gsub(/^./){|x| x.upcase })
8382
if negative
84-
last_json.should_not have_json_type(klass).at_path(path)
83+
last_json.should_not have_json_type(type).at_path(path)
8584
else
86-
last_json.should have_json_type(klass).at_path(path)
85+
last_json.should have_json_type(type).at_path(path)
8786
end
8887
end
8988

0 commit comments

Comments
 (0)