1
0
Fork 0
mirror of https://github.com/jnunemaker/httparty synced 2023-03-27 23:23:07 -04:00

allow a format :plain option

Signed-off-by: John Nunemaker <nunemaker@gmail.com>
This commit is contained in:
jgeiger 2009-03-06 04:53:13 +08:00 committed by John Nunemaker
parent c077207d33
commit acd306859d
2 changed files with 7 additions and 1 deletions

View file

@ -18,7 +18,8 @@ module HTTParty
'text/javascript' => :json,
'text/html' => :html,
'application/x-yaml' => :yaml,
'text/yaml' => :yaml
'text/yaml' => :yaml,
'text/plain' => :plain
} unless defined?(AllowedFormats)
def self.included(base)

View file

@ -149,6 +149,11 @@ describe HTTParty do
@klass.default_options[:format].should == :yaml
end
it "should allow plain" do
@klass.format :plain
@klass.default_options[:format].should == :plain
end
it 'should not allow funky format' do
lambda do
@klass.format :foobar