Skip to content

Commit

Permalink
fixed broken examples under Ruby 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Aug 16, 2014
1 parent d3f83d1 commit a05dd33
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
10 changes: 9 additions & 1 deletion library/net/http/http/options_spec.rb
Expand Up @@ -21,7 +21,15 @@

it "sends an options request to the passed path and returns the response" do
response = @http.options("/request")
response.body.should == "Request type: OPTIONS"

ruby_version_is ''...'2.2' do
# OPTIONS responses have no bodies
response.body.should be_nil
end

ruby_version_is '2.2' do
response.body.should == "Request type: OPTIONS"
end
end

it "returns a Net::HTTPResponse" do
Expand Down
8 changes: 7 additions & 1 deletion library/net/http/http/request_types_spec.rb
Expand Up @@ -105,7 +105,13 @@
end

it "has no Respone Body" do
Net::HTTP::Options::RESPONSE_HAS_BODY.should be_true
ruby_version_is ''...'2.2' do
Net::HTTP::Options::RESPONSE_HAS_BODY.should be_false
end

ruby_version_is '2.2' do
Net::HTTP::Options::RESPONSE_HAS_BODY.should be_true
end
end
end

Expand Down

0 comments on commit a05dd33

Please sign in to comment.