Sha256: 1fb49bf621d3d577c1f6d401576016943f8af94a91f607916a4a853246e7ef16

Contents?: true

Size: 1.06 KB

Versions: 14

Compression:

Stored size: 1.06 KB

Contents

require 'helper'
require 'cassanity/argument_generators/using_clause'

describe Cassanity::ArgumentGenerators::UsingClause do
  describe "#call" do
    context "with single :using option" do
      it "returns array of arguments" do
        subject.call({
          using: {
            ttl: 500,
          }
        }).should eq([
          " USING TTL 500",
        ])
      end
    end

    context "with multiple :using option" do
      it "returns array of arguments" do
        subject.call({
          using: {
            ttl: 500,
            consistency: 'quorum',
            timestamp: 1234,
          }
        }).should eq([
          " USING TTL 500 AND CONSISTENCY quorum AND TIMESTAMP 1234",
        ])
      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

14 entries across 14 versions & 1 rubygems

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