All tests pass in merb

This commit is contained in:
Gwyn Morfey 2008-04-18 16:39:28 +01:00
parent aeb6aa056c
commit c967a02ca0
4 changed files with 5 additions and 16 deletions

View File

@ -102,4 +102,7 @@ require 'cgi'
require File.join(File.dirname(__FILE__), "merb_support", "param_parser.rb")
require File.join(File.dirname(__FILE__), "merb_support", "url_encoded_pair_parser.rb")
require File.join(File.dirname(__FILE__), "merb_support", "indifferent_access.rb")
require File.join(File.dirname(__FILE__), "merb_support", "support.rb")

View File

@ -1,7 +1,6 @@
# This class has dubious semantics and we only have it so that
# people can write params[:key] instead of params['key']
# and they get the same value for both keys.
class HashWithIndifferentAccess < Hash
def initialize(constructor = {})
if constructor.is_a?(Hash)
@ -123,16 +122,4 @@ class HashWithIndifferentAccess < Hash
end
end
module ActiveSupport #:nodoc:
module CoreExtensions #:nodoc:
module Hash #:nodoc:
module IndifferentAccess #:nodoc:
def with_indifferent_access
hash = HashWithIndifferentAccess.new(self)
hash.default = self.default
hash
end
end
end
end
end

View File

@ -10,7 +10,6 @@ module Webrat
end
if defined?(Merb)
puts "************ Booting merb mode"
require File.join(File.dirname(__FILE__), "boot_merb.rb")
else
require File.join(File.dirname(__FILE__), "boot_rails.rb")

View File

@ -123,7 +123,7 @@ module Webrat
def merge_hash_values(a, b) # :nodoc:
a.keys.each do |k|
if b.has_key?(k)
case [a[k], b[k]].map(&:class)
case [a[k].class, b[k].class]
when [Hash, Hash]
a[k] = merge_hash_values(a[k], b[k])
b.delete(k)