Sha256: 3236103fc7c26c46ffd8e1d2f84e775cfb9d9213386bae369a251b5ef8e3b543

Contents?: true

Size: 1.07 KB

Versions: 14

Compression:

Stored size: 1.07 KB

Contents

require 'helper'
require 'cassanity/argument_generators/index_create'

describe Cassanity::ArgumentGenerators::IndexCreate do
  describe "#call" do
    it "returns array of arguments" do
      cql = "CREATE INDEX ON mutants (ability_id)"
      expected = [cql]
      subject.call({
        column_family_name: :mutants,
        column_name: :ability_id,
      }).should eq(expected)
    end

    context "with :keyspace_name" do
      it "returns array of arguments" do
        cql = "CREATE INDEX ON app.mutants (ability_id)"
        expected = [cql]
        subject.call({
          keyspace_name: :app,
          column_family_name: :mutants,
          column_name: :ability_id,
        }).should eq(expected)
      end
    end

    context "with :name" do
      it "returns array of arguments with name in cql" do
        cql = "CREATE INDEX ability_index ON mutants (ability_id)"
        expected = [cql]
        subject.call({
          name: :ability_index,
          column_family_name: :mutants,
          column_name: :ability_id,
        }).should eq(expected)
      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/index_create_spec.rb
cassanity-0.6.0.beta5 spec/unit/cassanity/argument_generators/index_create_spec.rb
cassanity-0.6.0.beta4 spec/unit/cassanity/argument_generators/index_create_spec.rb
cassanity-0.6.0.beta3 spec/unit/cassanity/argument_generators/index_create_spec.rb
cassanity-0.6.0.beta2 spec/unit/cassanity/argument_generators/index_create_spec.rb
cassanity-0.6.0.beta1 spec/unit/cassanity/argument_generators/index_create_spec.rb
cassanity-0.5.1 spec/unit/cassanity/argument_generators/index_create_spec.rb
cassanity-0.5.0 spec/unit/cassanity/argument_generators/index_create_spec.rb
cassanity-0.4.0 spec/unit/cassanity/argument_generators/index_create_spec.rb
cassanity-0.3.0 spec/unit/cassanity/argument_generators/index_create_spec.rb
cassanity-0.2.2 spec/unit/cassanity/argument_generators/index_create_spec.rb
cassanity-0.2.1 spec/unit/cassanity/argument_generators/index_create_spec.rb
cassanity-0.2.0 spec/unit/cassanity/argument_generators/index_create_spec.rb
cassanity-0.1.0 spec/unit/cassanity/argument_generators/index_create_spec.rb