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:
parent
c077207d33
commit
acd306859d
2 changed files with 7 additions and 1 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue