Sha256: 30ef09a086af0864030c2d4d4af4be2bd53cf3382e46f1a734560165b3109102

Contents?: true

Size: 985 Bytes

Versions: 27

Compression:

Stored size: 985 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)
  require 'mocha' unless Object.const_defined?(:Mocha)
rescue LoadError => load_error
  $stderr.puts "Skipping #{test_name} tests. `gem install mocha` and try again."
else
  yield
end

Version data entries

27 entries across 27 versions & 14 rubygems

Version Path
decisiv-will_paginate-2.3.6.1 test/helper.rb
decisiv-will_paginate-2.3.6 test/helper.rb
gohanlon-will_paginate-2.3.3 test/helper.rb
jcnetdev-will_paginate-2.3.21 test/helper.rb
mislav-will_paginate-2.2.3 test/helper.rb
mislav-will_paginate-2.3.0 test/helper.rb
mislav-will_paginate-2.3.1 test/helper.rb
mislav-will_paginate-2.3.2 test/helper.rb
mislav-will_paginate-2.3.3 test/helper.rb
mislav-will_paginate-2.3.4 test/helper.rb
mislav-will_paginate-2.3.5 test/helper.rb
mislav-will_paginate-2.3.6 test/helper.rb
mislav-will_paginate-2.3.7 test/helper.rb
myobie-will_paginate-2.3.5 test/helper.rb
oboxodo-will_paginate-2.3.5 test/helper.rb
pcg79-will_paginate-2.3.2 test/helper.rb
shingara-will_paginate-2.3.3 test/helper.rb
staugaard-will_paginate-2.3.3 test/helper.rb
stilkov-will_paginate-2.3.6 test/helper.rb
rails_tinymce-0.0.1 plugins/will_paginate/test/helper.rb