Sha256: c3b7f1521d40a2c720aac834c10ad55e5ecde41463ea912c75af242900661930

Contents?: true

Size: 1005 Bytes

Versions: 12

Compression:

Stored size: 1005 Bytes

Contents

require 'helper'
require 'cassanity/argument_generators/order_clause'

describe Cassanity::ArgumentGenerators::OrderClause do
  describe "#call" do
    context "with single :order" do
      it "returns array of arguments" do
        subject.call(order: 'name').should eq([" ORDER BY name"])
      end
    end

    context "with single :order ASC" do
      it "returns array of arguments" do
        subject.call(order: 'name ASC').should eq([" ORDER BY name ASC"])
      end
    end

    context "with single :order DESC" do
      it "returns array of arguments" do
        subject.call(order: 'name DESC').should eq([" ORDER BY name DESC"])
      end
    end

    context "with no arguments" do
      it "returns array of arguments where only item is empty string" do
        subject.call.should eq([""])
      end
    end

    context "with empty arguments" do
      it "returns array of arguments where only item is empty string" do
        subject.call({}).should eq([""])
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
cassanity-0.6.0 spec/unit/cassanity/argument_generators/order_clause_spec.rb
cassanity-0.6.0.beta5 spec/unit/cassanity/argument_generators/order_clause_spec.rb
cassanity-0.6.0.beta4 spec/unit/cassanity/argument_generators/order_clause_spec.rb
cassanity-0.6.0.beta3 spec/unit/cassanity/argument_generators/order_clause_spec.rb
cassanity-0.6.0.beta2 spec/unit/cassanity/argument_generators/order_clause_spec.rb
cassanity-0.6.0.beta1 spec/unit/cassanity/argument_generators/order_clause_spec.rb
cassanity-0.5.1 spec/unit/cassanity/argument_generators/order_clause_spec.rb
cassanity-0.5.0 spec/unit/cassanity/argument_generators/order_clause_spec.rb
cassanity-0.4.0 spec/unit/cassanity/argument_generators/order_clause_spec.rb
cassanity-0.3.0 spec/unit/cassanity/argument_generators/order_clause_spec.rb
cassanity-0.2.2 spec/unit/cassanity/argument_generators/order_clause_spec.rb
cassanity-0.2.1 spec/unit/cassanity/argument_generators/order_clause_spec.rb