From 3e3d23383a160119d9ba048c2380bf85994862cb Mon Sep 17 00:00:00 2001 From: Anthony Eden Date: Fri, 17 Jul 2009 01:07:54 +0800 Subject: [PATCH] fix failing spec Signed-off-by: John Nunemaker --- lib/httparty.rb | 2 +- spec/httparty_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/httparty.rb b/lib/httparty.rb index 362df86..a6b4512 100644 --- a/lib/httparty.rb +++ b/lib/httparty.rb @@ -102,7 +102,7 @@ module HTTParty # format :json # end def format(f) - raise UnsupportedFormat, "Must be one of: #{AllowedFormats.values.uniq.join(', ')}" unless AllowedFormats.value?(f) + raise UnsupportedFormat, "Must be one of: #{AllowedFormats.values.map(&:to_s).uniq.sort.join(', ')}" unless AllowedFormats.value?(f) default_options[:format] = f end diff --git a/spec/httparty_spec.rb b/spec/httparty_spec.rb index 07c042d..9679f5c 100644 --- a/spec/httparty_spec.rb +++ b/spec/httparty_spec.rb @@ -175,7 +175,7 @@ describe HTTParty do it 'should only print each format once with an exception' do lambda do @klass.format :foobar - end.should raise_error(HTTParty::UnsupportedFormat, "Must be one of: json, plain, html, yaml, xml") + end.should raise_error(HTTParty::UnsupportedFormat, "Must be one of: html, json, plain, xml, yaml") end end