Skip to content

Instantly share code, notes, and snippets.

@phiggins
Created May 24, 2010 01:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phiggins/411433 to your computer and use it in GitHub Desktop.
Save phiggins/411433 to your computer and use it in GitHub Desktop.
phiggins@lihnucks ~/work/httparty/head $ rvm ruby-1.8.7,jruby-1.5.0,jruby-head rake spec
ruby-1.8.7-p249: ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
(in /home/phiggins/work/httparty/head)
/home/phiggins/.rvm/gems/ruby-1.8.7-p249/gems/jeweler-1.4.0/lib/jeweler/commands/check_dependencies.rb:13:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement
All dependencies seem to be installed.
warning: HTTParty depends on version 0.1.7 of crack, not 0.1.6.
Example disabled: should allow hashes to be accessed with dot notation
Example disabled: should allow nested hashes to be accessed with dot notation
HTTParty::Request
- should not attempt to parse empty responses
- should not fail for missing mime type
HTTParty::Request initialization
- sets parser to HTTParty::Parser
- sets parser to the optional parser
HTTParty::Request#format
- should return the correct parsing format
HTTParty::Request options
- should use basic auth when configured
- should use digest auth when configured
HTTParty::Request#uri query strings
- does not add an empty query string when default_params are blank
HTTParty::Request http
- should use ssl for port 443
- should not use ssl for port 80
- uses ssl for https scheme with default port
- uses ssl for https scheme regardless of port
HTTParty::Request http PEM certificates when scheme is https
- should use a PEM certificate when provided
- should verify the certificate when provided
HTTParty::Request http PEM certificates when scheme is not https
- does not assign a PEM
- should not verify a certificate if scheme is not https
HTTParty::Request http PEM certificates debugging
- calls #set_debug_output when the option is provided
- does not set_debug_output when the option is not provided
HTTParty::Request http when setting timeout
- does nothing if the timeout option is a string
- sets the timeout to 5 seconds
HTTParty::Request#format_from_mimetype
- should handle text/xml
- should handle application/xml
- should handle text/json
- should handle application/json
- should handle text/javascript
- should handle application/javascript
- returns nil for an unrecognized mimetype
- returns nil when using a default parser
HTTParty::Request parsing responses
- should handle xml automatically
- should handle json automatically
- should handle yaml automatically
- should include any HTTP headers in the returned response
HTTParty::Request parsing responses with non-200 responses
- should return a valid object for 4xx response
- should return a valid object for 5xx response
HTTParty::Request parsing responses with non-200 responses 3xx responses
- returns a valid object for 304 not modified
- redirects if a 300 contains a location header
- returns the Net::HTTP response if the 300 does not contain a location header
HTTParty::Request a request that redirects once
- should be handled by GET transparently
- should be handled by POST transparently
- should be handled by DELETE transparently
- should be handled by PUT transparently
- should be handled by HEAD transparently
- should be handled by OPTIONS transparently
- should keep track of cookies between redirects
- should update cookies with rediects
- should keep cookies between rediects
- should make resulting request a get request if it not already
- should not make resulting request a get request if options[:maintain_method_across_redirects] is true
HTTParty::Request a request that redirects infinitely
- should raise an exception
HTTParty::Request with POST http method
- should raise argument error if query is not a hash
HTTParty::Request argument validation
- should raise argument error if basic_auth and digest_auth are both present
- should raise argument error if basic_auth is not a hash
- should raise argument error if digest_auth is not a hash
HTTParty::Response
- returns response headers
- should send missing methods to delegate
- should be able to iterate if it is array
- allows headers to be accessed by mixed-case names in hash notation
- returns a comma-delimited value when multiple values exist
- responds to hash methods
HTTParty::Response initialization
- should set the Net::HTTP Response
- should set body
- should set code
- should set code as a Fixnum
HTTParty::Parser.SupportedFormats
- returns a hash
HTTParty::Parser.call
- generates an HTTParty::Parser instance with the given body and format
- calls #parse on the parser
HTTParty::Parser.formats
- returns the SupportedFormats constant
- returns the SupportedFormats constant for subclasses
HTTParty::Parser.format_from_mimetype
- returns a symbol representing the format mimetype
- returns nil when the mimetype is not supported
HTTParty::Parser.supported_formats
- returns a unique set of supported formats represented by symbols
HTTParty::Parser.supports_format?
- returns true for a supported format
- returns false for an unsupported format
HTTParty::Parser#parse
- attempts to parse supported formats
- returns the unparsed body when the format is unsupported
- returns nil for an empty body
- returns nil for a nil body
HTTParty::Parser#supports_format?
- utilizes the class method to determine if the format is supported
HTTParty::Parser#parse_supported_format
- calls the parser for the given format
HTTParty::Parser#parse_supported_format when a parsing method does not exist for the given format
- raises an exception
- raises a useful exception message for subclasses
HTTParty::Parser parsers
- parses xml with Crack
- parses json with Crack
- parses yaml
- parses html by simply returning the body
- parses plain text by simply returning the body
HTTParty::CookieHash#add_cookies with a hash
- should add new key/value pairs to the hash
- should overwrite any existing key
HTTParty::CookieHash#add_cookies with a string
- should add new key/value pairs to the hash
- should overwrite any existing key
HTTParty::CookieHash#add_cookies with other class
- should error
HTTParty::CookieHash#to_cookie_string
- should format the key/value pairs, delimited by semi-colons
- should not include client side only cookies
HTTParty AllowedFormats deprecated
- warns with a deprecation message
- returns HTTPart::Parser::SupportedFormats
HTTParty base uri
- should have reader
- should have writer
- should not modify the parameter during assignment
HTTParty#normalize_base_uri
- should add http if not present for non ssl requests
- should add https if not present for ssl requests
- should not remove https for ssl requests
- should not modify the parameter
HTTParty headers
- should default to empty hash
- should be able to be updated
- uses the class headers when sending a request
- overwrites class headers when passing in headers
HTTParty headers with cookies
- utilizes the class-level cookies
- adds cookies to the headers
- adds optional cookies to the optional headers
HTTParty cookies
- should not be in the headers by default
- should raise an ArgumentError if passed a non-Hash
- should allow a cookie to be specified with a one-off request
HTTParty cookies when a cookie is set at the class level
- should include that cookie in the request
- should pass the proper cookies when requested multiple times
- should allow the class defaults to be overridden
HTTParty cookies in a class with multiple methods that use different cookies
- should not allow cookies used in one method to carry over into other methods
HTTParty default params
- should default to empty hash
- should be able to be updated
HTTParty default timeout
- should default to nil
- should support updating
HTTParty debug_output
- stores the given stream as a default_option
- stores the $stderr stream by default
HTTParty basic http authentication
- should work
HTTParty digest http authentication
- should work
HTTParty parser
- should set parser options
- should be able parse response with custom parser
- raises UnsupportedFormat when the parser cannot handle the format
- does not validate format whe custom parser is a proc
HTTParty format
- should allow xml
- should allow json
- should allow yaml
- should allow plain
- should not allow funky format
- should only print each format once with an exception
- sets the default parser
- does not reset parser to the default parser
HTTParty#no_follow
- sets no_follow to false by default
- sets the no_follow option to true
HTTParty#maintain_method_across_redirects
- sets maintain_method_across_redirects to true by default
- sets the maintain_method_across_redirects option to false
HTTParty with explicit override of automatic redirect handling
- should fail with redirected GET
- should fail with redirected POST
- should fail with redirected DELETE
- should fail with redirected PUT
- should fail with redirected HEAD
- should fail with redirected OPTIONS
HTTParty with multiple class definitions
- should not run over each others options
HTTParty two child classes inheriting from one parent
- does not modify each others inherited attributes
HTTParty#get
- should be able to get html
- should be able parse response type json automatically
- should be able parse response type xml automatically
- should not get undefined method add_node for nil class for the following xml
- should parse empty response fine
- should accept http URIs
- should accept https URIs
- should raise an ArgumentError on URIs that are not http or https
- should raise an InvalidURIError on URIs that can't be parsed at all
Finished in 0.267814 seconds
157 examples, 0 failures
jruby-1.5.0: jruby 1.5.0 (ruby 1.8.7 patchlevel 249) (2010-05-12 6769999) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_20) [amd64-java]
(in /home/phiggins/work/httparty/head)
/home/phiggins/.rvm/gems/jruby-1.5.0/gems/jeweler-1.4.0/lib/jeweler/commands/check_dependencies.rb:13:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement
All dependencies seem to be installed.
JRuby limited openssl loaded. http://jruby.org/openssl
gem install jruby-openssl for full support.
warning: HTTParty depends on version 0.1.7 of crack, not 0.1.6.
Example disabled: should allow hashes to be accessed with dot notation
Example disabled: should allow nested hashes to be accessed with dot notation
./spec/httparty/parser_spec.rb:3: superclass mismatch for class CustomParser (TypeError)
from ./spec/httparty/parser_spec.rb:15:in `load'
from /home/phiggins/.rvm/gems/jruby-1.5.0/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:15:in `load_files'
from /home/phiggins/.rvm/gems/jruby-1.5.0/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:14:in `each'
from /home/phiggins/.rvm/gems/jruby-1.5.0/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:14:in `load_files'
from /home/phiggins/.rvm/gems/jruby-1.5.0/gems/rspec-1.3.0/lib/spec/runner/options.rb:133:in `run_examples'
from /home/phiggins/.rvm/gems/jruby-1.5.0/gems/rspec-1.3.0/lib/spec/runner/command_line.rb:9:in `run'
from /home/phiggins/.rvm/gems/jruby-1.5.0/gems/rspec-1.3.0/bin/spec:5
rake aborted!
Command /home/phiggins/.rvm/rubies/jruby-1.5.0/bin/jruby -I"lib:lib:spec" "/home/phiggins/.rvm/gems/jruby-1.5.0/gems/rspec-1.3.0/bin/spec" "spec/httparty_spec.rb" "spec/httparty/request_spec.rb" "spec/httparty/response_spec.rb" "spec/httparty/parser_spec.rb" "spec/httparty/cookie_hash_spec.rb" --options spec/spec.opts failed
(See full trace by running task with --trace)
jruby-head: jruby 1.6.0.dev (ruby 1.8.7 patchlevel 249) (2010-05-23 7b76286) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_20) [amd64-java]
(in /home/phiggins/work/httparty/head)
/home/phiggins/.rvm/gems/jruby-head/gems/jeweler-1.4.0/lib/jeweler/commands/check_dependencies.rb:13:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement
All dependencies seem to be installed.
JRuby limited openssl loaded. http://jruby.org/openssl
gem install jruby-openssl for full support.
warning: HTTParty depends on version 0.1.7 of crack, not 0.1.6.
Example disabled: should allow hashes to be accessed with dot notation
Example disabled: should allow nested hashes to be accessed with dot notation
./spec/httparty/parser_spec.rb:3: superclass mismatch for class CustomParser (TypeError)
from ./spec/httparty/parser_spec.rb:15:in `load'
from /home/phiggins/.rvm/gems/jruby-head/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:15:in `load_files'
from /home/phiggins/.rvm/gems/jruby-head/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:14:in `each'
from /home/phiggins/.rvm/gems/jruby-head/gems/rspec-1.3.0/lib/spec/runner/example_group_runner.rb:14:in `load_files'
from /home/phiggins/.rvm/gems/jruby-head/gems/rspec-1.3.0/lib/spec/runner/options.rb:133:in `run_examples'
from /home/phiggins/.rvm/gems/jruby-head/gems/rspec-1.3.0/lib/spec/runner/command_line.rb:9:in `run'
from /home/phiggins/.rvm/gems/jruby-head/gems/rspec-1.3.0/bin/spec:5
rake aborted!
Command /home/phiggins/.rvm/rubies/jruby-head/bin/jruby -I"lib:lib:spec" "/home/phiggins/.rvm/gems/jruby-head/gems/rspec-1.3.0/bin/spec" "spec/httparty_spec.rb" "spec/httparty/request_spec.rb" "spec/httparty/response_spec.rb" "spec/httparty/parser_spec.rb" "spec/httparty/cookie_hash_spec.rb" --options spec/spec.opts failed
(See full trace by running task with --trace)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment