lib/rspec-api/dsl/route.rb in rspec-api-0.1.2 vs lib/rspec-api/dsl/route.rb in rspec-api-0.2.0

- old
+ new

@@ -1,5 +1,8 @@ +require 'active_support/core_ext/object' # present? + + module DSL module Route extend ActiveSupport::Concern def send_request(verb, route, body) @@ -105,11 +108,11 @@ "#{text} #{values.map{|k,v| "#{k}#{" #{v}" unless v.is_a?(Proc)}"}.to_sentence}" end end def parse_request_arguments(args) - text = args.first.is_a?(String) ? args.first : '' - values = args.first.is_a?(String) ? args.second : args.first + text = args.first.is_a?(String) ? args[0] : '' + values = args.first.is_a?(String) ? args[1] : args[0] [text, values || {}] # NOTE: In Ruby 2.0 we could write values.to_h end end end end \ No newline at end of file