Sha256: 48bb4d039cc59a78d0dae91654dcae67597ef3a2323d70a0148e9629c69f3ad2

Contents?: true

Size: 900 Bytes

Versions: 7

Compression:

Stored size: 900 Bytes

Contents

require 'helper'

module Arel
  module Nodes
    class TestBin < MiniTest::Unit::TestCase
      def test_new
        assert Arel::Nodes::Bin.new('zomg')
      end

      def test_default_to_sql
        viz  = Arel::Visitors::ToSql.new Table.engine.connection_pool
        node = Arel::Nodes::Bin.new(Arel.sql('zomg'))
        assert_equal 'zomg', viz.accept(node)
      end

      def test_mysql_to_sql
        viz  = Arel::Visitors::MySQL.new Table.engine.connection_pool
        node = Arel::Nodes::Bin.new(Arel.sql('zomg'))
        assert_equal 'BINARY zomg', viz.accept(node)
      end

      def test_equality_with_same_ivars
        array = [Bin.new('zomg'), Bin.new('zomg')]
        assert_equal 1, array.uniq.size
      end

      def test_inequality_with_different_ivars
        array = [Bin.new('zomg'), Bin.new('zomg!')]
        assert_equal 2, array.uniq.size
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
arel-4.0.2 test/nodes/test_bin.rb
arel-5.0.0 test/nodes/test_bin.rb
arel-4.0.1 test/nodes/test_bin.rb
challah-1.0.0 vendor/bundle/gems/arel-4.0.0/test/nodes/test_bin.rb
arel-4.0.0 test/nodes/test_bin.rb
arel-4.0.0.beta2 test/nodes/test_bin.rb
arel-4.0.0.beta1 test/nodes/test_bin.rb