Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 4386

Show
Ignore:
Timestamp:
05/31/06 22:43:53 (2 years ago)
Author:
bitsweat
Message:

fix test warnings

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activesupport/lib/active_support/core_ext/load_error.rb

    r1735 r4386  
    99    path.gsub(/\.rb$/, '') == self.path.gsub(/\.rb$/, '') 
    1010  end 
    11    
     11 
    1212  def self.from_message(message) 
    1313    REGEXPS.each do |regexp, capture| 
     
    1717    nil 
    1818  end 
    19    
     19 
    2020  REGEXPS = [ 
    2121    [/^no such file to load -- (.+)$/i, 1], 
    2222    [/^Missing \w+ (file\s*)?([^\s]+.rb)$/i, 2], 
    2323    [/^Missing API definition file in (.+)$/i, 1] 
    24   ] 
     24  ] unless defined?(REGEXPS) 
    2525end 
    2626 
  • trunk/activesupport/lib/active_support/ordered_options.rb

    r4318 r4386  
    11# OrderedHash is namespaced to prevent conflicts with other implementations 
    2 class ActiveSupport::OrderedHash < Array #:nodoc: 
    3   def []=(key, value)     
    4     if pair = find_pair(key) 
    5       pair.pop 
    6       pair << value 
    7     else 
    8       self << [key, value] 
     2module ActiveSupport 
     3  class OrderedHash < Array #:nodoc: 
     4    def []=(key, value) 
     5      if pair = find_pair(key) 
     6        pair.pop 
     7        pair << value 
     8      else 
     9        self << [key, value] 
     10      end 
    911    end 
     12 
     13    def [](key) 
     14      pair = find_pair(key) 
     15      pair ? pair.last : nil 
     16    end 
     17 
     18    def keys 
     19      self.collect { |i| i.first } 
     20    end 
     21 
     22    private 
     23      def find_pair(key) 
     24        self.each { |i| return i if i.first == key } 
     25        return false 
     26      end 
    1027  end 
    11    
    12   def [](key) 
    13     pair = find_pair(key) 
    14     pair ? pair.last : nil 
    15   end 
    16  
    17   def keys 
    18     self.collect { |i| i.first } 
    19   end 
    20  
    21   private 
    22     def find_pair(key) 
    23       self.each { |i| return i if i.first == key } 
    24       return false 
    25     end 
    2628end 
    2729 
     
    3032    super(key.to_sym, value) 
    3133  end 
    32    
     34 
    3335  def [](key) 
    3436    super(key.to_sym) 
  • trunk/activesupport/lib/active_support/values/time_zone.rb

    r787 r4386  
    170170    # A regular expression that matches the names of all time zones in 
    171171    # the USA. 
    172     US_ZONES = /US|Arizona|Indiana|Hawaii|Alaska/ 
     172    US_ZONES = /US|Arizona|Indiana|Hawaii|Alaska/ unless defined?(US_ZONES) 
    173173 
    174174    # A convenience method for returning a collection of TimeZone objects 
  • trunk/activesupport/test/core_ext/kernel_test.rb

    r3134 r4386  
    3535    silence_stderr { STDERR.puts 'hello world' } 
    3636    assert_equal old_stderr_position, STDERR.tell 
     37  rescue Errno::ESPIPE 
     38    # Skip if we can't STDERR.tell 
    3739  end 
    3840 
  • trunk/activesupport/test/core_ext/module_test.rb

    r4311 r4386  
    128128 
    129129  def test_alias_method_chain 
    130     assert @instance.respond_to? :bar 
     130    assert @instance.respond_to?(:bar) 
    131131    feature_aliases = [:bar_with_baz, :bar_without_baz] 
    132132 
     
    153153    FooClassWithBarMethod.alias_method_chain :quux!, :baz 
    154154    assert @instance.respond_to?(:quux_with_baz) 
    155      
     155 
    156156    assert_equal 'quux_with_baz', @instance.quux! 
    157157    assert_equal 'quux', @instance.quux_without_baz