Sha256: 72cb95b0d7863fad87996f5870c55326f46ed3aec3cafb03a1bfdfa96fd0d1c6

Contents?: true

Size: 1.29 KB

Versions: 12

Compression:

Stored size: 1.29 KB

Contents

require File.join(File.dirname(__FILE__), '..', '/test_helper')

class SymbolOperatorTest < MiniTest::Unit::TestCase
  context "An instance of a SymbolOperator" do
    should "lower camelize the target" do
      assert_equal "ga:uniqueVisits==", SymbolOperator.new(:unique_visits, :eql).to_google_analytics
    end

    should "return target and operator together" do
      assert_equal "ga:metric==", SymbolOperator.new(:metric, :eql).to_google_analytics
    end

    should "prefix the operator to the target" do
      assert_equal "-ga:metric", SymbolOperator.new(:metric, :desc).to_google_analytics
    end

    # should "know if it is equal to another operator" do
    #   op1 = SymbolOperator.new(:hello, "==")
    #   op2 = SymbolOperator.new(:hello, "==")
    #   assert_equal op1, op2
    # end
    # 
    # should "not be equal to another operator if target, operator, or prefix is different" do
    #   op1 = SymbolOperator.new(:hello, "==")
    #   op2 = SymbolOperator.new(:hello, "==", true)
    #   refute_equal op1, op2
    # 
    #   op1 = SymbolOperator.new(:hello1, "==")
    #   op2 = SymbolOperator.new(:hello2, "==")
    #   refute_equal op1, op2
    # 
    #   op1 = SymbolOperator.new(:hello, "!=")
    #   op2 = SymbolOperator.new(:hello, "==")
    #   refute_equal op1, op2
    # end
  end
end

Version data entries

12 entries across 12 versions & 4 rubygems

Version Path
garb-0.7.5 test/unit/symbol_operator_test.rb
shingara-garb-0.7.6 test/unit/symbol_operator_test.rb
garb-no-activesupport-0.7.4 test/unit/symbol_operator_test.rb
garb-0.7.4 test/unit/symbol_operator_test.rb
garb-no-activesupport-0.7.3 test/unit/symbol_operator_test.rb
garb-0.7.3 test/unit/symbol_operator_test.rb
garb-0.7.2 test/unit/symbol_operator_test.rb
garb-0.7.1 test/unit/symbol_operator_test.rb
garb-authsub-0.7.0 test/unit/symbol_operator_test.rb
garb-0.7.0 test/unit/symbol_operator_test.rb
garb-0.6.0 test/unit/symbol_operator_test.rb
garb-0.5.1 test/unit/symbol_operator_test.rb