Permalink
Browse files

reenabled tests

  • Loading branch information...
1 parent 8a0733c commit 3a36097928f75745d6943662c186ee6c28157175 @hukl committed Aug 14, 2010
Showing with 8 additions and 6 deletions.
  1. +3 −1 lib/rig/http.rb
  2. +5 −5 test/test_http.rb
View
@@ -38,10 +38,12 @@ def prepare_body
def multipart?
if defined? @multipart
@multipart
- else
+ elsif @options[:body]
@multipart = @options[:body].values.any? do |element|
element.respond_to?( :read )
end
+ else
+ @multipart = false
end
end
View
@@ -145,11 +145,11 @@ class TestHttp < Test::Unit::TestCase
assert !request.multipart?, "Should not be multipart"
end
- #test "http object has accessible params" do
- # get = HTTP.new( {:host => "localhost", :params => {"foo" => "bar"}} )
- # assert_not_nil get.params
- # assert_equal ({"foo" => "bar"}), get.params
- #end
+ test "http object has accessible options" do
+ get = HTTP.new( {:host => "localhost", :query => {"foo" => "bar"}} )
+ assert_not_nil get.options
+ assert_equal ({"foo" => "bar"}), get.options[:query]
+ end
#test "http object without params specified returns empty params" do
# get = HTTP.new( {:host => "localhost"} )

0 comments on commit 3a36097

Please sign in to comment.