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

Ticket #1689: mocha_0.5.5_for_ruby1.9.diff

File mocha_0.5.5_for_ruby1.9.diff, 0.9 kB (added by chuyeow, 9 months ago)

Patch for mocha 0.5.5 Ruby 1.9 compat so that mocha tests work

  • lib/mocha/yield_parameters.rb

    old new  
    1212     
    1313    def next_invocation 
    1414      case @parameter_groups.size 
    15       when 0: NoYields.new 
    16       when 1: @parameter_groups.first 
     15      when 0; NoYields.new 
     16      when 1; @parameter_groups.first 
    1717      else @parameter_groups.shift 
    1818      end 
    1919    end 
  • lib/mocha/return_values.rb

    old new  
    1616     
    1717    def next 
    1818      case @values.size 
    19       when 0: nil 
    20       when 1: @values.first.evaluate 
     19      when 0; nil 
     20      when 1; @values.first.evaluate 
    2121      else @values.shift.evaluate 
    2222      end 
    2323    end