features/step_definitions/json_steps.rb in berkshelf-5.6.5 vs features/step_definitions/json_steps.rb in berkshelf-6.0.0
- old
+ new
@@ -12,12 +12,18 @@
seed
end
end
end
+# Pending Ridley allowing newer Faraday and Celluloid.
+def clean_json_output(output)
+ output.gsub(/^.+warning: constant ::Fixnum is deprecated$/, '') \
+ .gsub(/^.*forwarding to private method Celluloid::PoolManager#url_prefix$/, '')
+end
+
Then /^the output should contain JSON:$/ do |data|
parsed = ERB.new(data).result
target = JSON.pretty_generate(JSON.parse(parsed).sort_by_key)
- actual = JSON.pretty_generate(JSON.parse(all_commands.map { |c| c.output }.join("\n")).sort_by_key)
+ actual = JSON.pretty_generate(JSON.parse(all_commands.map { |c| clean_json_output(c.output) }.join("\n")).sort_by_key)
expect(actual).to eq(target)
end