Skip to content

Commit

Permalink
Fix "superclass mismatch for class CustomParser (TypeError)" when run…
Browse files Browse the repository at this point in the history
…ning tests

This error would occur when spec/httparty_spec.rb was loaded before
spec/httparty/parser_spec.rb.

This is less likely to happen on OSX than on Linux, because Dir.glob on OSX
returns items sorted alphabetically, whereas on Linux the ordering depends on
the underlying filesystem ordering.
  • Loading branch information
dlitz committed Jul 8, 2010
1 parent 24892b8 commit 48224f0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions spec/httparty/parser_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))

class CustomParser < HTTParty::Parser; end

describe HTTParty::Parser do
describe ".SupportedFormats" do
it "returns a hash" do
Expand Down
2 changes: 1 addition & 1 deletion spec/httparty_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))

class CustomParser
class CustomParser < HTTParty::Parser
def self.parse(body)
return {:sexy => true}
end
Expand Down

0 comments on commit 48224f0

Please sign in to comment.