Sha256: 969fd4ecbae379f041697670be9d9a2f4c74f25085028ea0e0c276a4f2f45432

Contents?: true

Size: 494 Bytes

Versions: 30

Compression:

Stored size: 494 Bytes

Contents

module M

  def assert_must_be_like a, b
    assert_equal a.gsub(/\s+/, ' ').strip, b.gsub(/\s+/, ' ').strip
  end

  def assert_sanitized_equal a, b
    a1 = a.gsub(/\W/, ' ').gsub(/\s/, '').strip
    b2 = b.gsub(/\W/, ' ').gsub(/\s/, '').strip
    assert_equal a1, b2
  end

  def assert_sorted_equal a, b
    assert_equal a.sort, b.sort
  end

  def assert_must_have_same_records a, b
    assert_sorted_equal a.map(&:id), b.map(&:id)
  end
end

class ActiveSupport::TestCase
  include M
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
nimbleshop_core-0.0.23 test/support/must_be_like.rb
nimbleshop_core-0.0.21 test/support/must_be_like.rb
nimbleshop_core-0.0.20 test/support/must_be_like.rb
nimbleshop_core-0.0.19 test/support/must_be_like.rb
nimbleshop_core-0.0.17 test/support/must_be_like.rb
nimbleshop_core-0.0.16 test/support/must_be_like.rb
nimbleshop_core-0.0.15 test/support/must_be_like.rb
nimbleshop_core-0.0.14 test/support/must_be_like.rb
nimbleshop_core-0.0.14.rc2 test/support/must_be_like.rb
nimbleshop_core-0.0.14.rc1 test/support/must_be_like.rb
nimbleshop_core-0.0.13 test/support/must_be_like.rb
nimbleshop_core-0.0.12 test/support/must_be_like.rb
nimbleshop_core-0.0.11 test/support/must_be_like.rb
nimbleshop_core-0.0.10 test/support/must_be_like.rb
nimbleshop_core-0.0.9 test/support/must_be_like.rb
nimbleshop_core-0.0.8 test/support/must_be_like.rb
nimbleshop_core-0.0.7 test/support/must_be_like.rb
nimbleshop_core-0.0.5 test/support/must_be_like.rb
nimbleshop_core-0.0.4.beta1 test/support/must_be_like.rb
nimbleshop_core-0.0.4 test/support/must_be_like.rb