Sha256: 283557f8a5c53b0a89c314e1273bf61722405260f2d93c3347b7c11bf240893a

Contents?: true

Size: 1023 Bytes

Versions: 12

Compression:

Stored size: 1023 Bytes

Contents

require 'test/unit'
require 'rubygems'

# gem install redgreen for colored test output
begin require 'redgreen'; rescue LoadError; end

require 'boot' unless defined?(ActiveRecord)

class Test::Unit::TestCase
  protected
  def assert_respond_to_all object, methods
    methods.each do |method|
      [method.to_s, method.to_sym].each { |m| assert_respond_to object, m }
    end
  end
  
  def collect_deprecations
    old_behavior = WillPaginate::Deprecation.behavior
    deprecations = []
    WillPaginate::Deprecation.behavior = Proc.new do |message, callstack|
      deprecations << message
    end
    result = yield
    [result, deprecations]
  ensure
    WillPaginate::Deprecation.behavior = old_behavior
  end
end

# Wrap tests that use Mocha and skip if unavailable.
def uses_mocha(test_name)
  unless Object.const_defined?(:Mocha)
    gem 'mocha', '>= 0.9.5'
    require 'mocha'
  end
rescue LoadError => load_error
  $stderr.puts "Skipping #{test_name} tests. `gem install mocha` and try again."
else
  yield
end

Version data entries

12 entries across 12 versions & 11 rubygems

Version Path
decisiv-will_paginate-2.3.8.1 test/helper.rb
fermion-will_paginate-2.3.8 test/helper.rb
gcirne-will_paginate-2.3.8 test/helper.rb
gigpark-will_paginate-2.3.11 test/helper.rb
kamal-will_paginate-2.3.8 test/helper.rb
mislav-will_paginate-2.3.10 test/helper.rb
mislav-will_paginate-2.3.8 test/helper.rb
shingara-will_paginate-2.3.10 test/helper.rb
stilkov-will_paginate-2.3.8 test/helper.rb
savage-beast-0.1.0 tested_plugins/mislav-will_paginate/test/helper.rb
leshill-will_paginate-2.3.11 test/helper.rb
will_paginate-2.3.11 test/helper.rb