Sha256: 8a73f6d25c06c565f0883ea82a29fec682ac3fd0c1a993da3330fe6c9cef427e

Contents?: true

Size: 762 Bytes

Versions: 15

Compression:

Stored size: 762 Bytes

Contents

require 'spec_helper'

describe SafetyPin::Query::WhereCondition do
  it "should be instantiated with a name, value, and comparator" do
    where_condition = SafetyPin::Query::WhereCondition.new("foo", "bar", "LIKE")
    where_condition.should_not be_nil
  end
  
  it "should generate a SQL WHERE string fragment" do
    where_condition = SafetyPin::Query::WhereCondition.new("foo", "bar", "LIKE")
    where_condition.sql_fragment.should eql("[foo] LIKE 'bar'")
  end
  
  it "should be equal based on its main attributes" do
    condition1 = SafetyPin::Query::WhereCondition.new("foo", "bar", "LIKE")
    condition2 = SafetyPin::Query::WhereCondition.new("foo", "bar", "LIKE")
    condition1.should == condition2
    condition1.should eql(condition2)
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
safety-pin-0.1.5 spec/where_condition_spec.rb
safety-pin-0.1.4 spec/where_condition_spec.rb
safety-pin-0.1.3 spec/where_condition_spec.rb
safety-pin-0.1.2 spec/where_condition_spec.rb
safety-pin-0.1.1 spec/where_condition_spec.rb
safety-pin-0.1.0 spec/where_condition_spec.rb
safety-pin-0.0.9 spec/where_condition_spec.rb
safety_pin-0.0.8 spec/where_condition_spec.rb
safety_pin-0.0.7 spec/where_condition_spec.rb
safety_pin-0.0.6 spec/where_condition_spec.rb
safety_pin-0.0.5 spec/where_condition_spec.rb
safety_pin-0.0.4 spec/where_condition_spec.rb
safety_pin-0.0.3 spec/where_condition_spec.rb
safety_pin-0.0.2 spec/where_condition_spec.rb
safety_pin-0.0.1 spec/where_condition_spec.rb