Sha256: 3bf043b44e423540a461335d9619571183ee58b2b93c08f51d838421ce5c3d68

Contents?: true

Size: 1.54 KB

Versions: 2

Compression:

Stored size: 1.54 KB

Contents

# Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
#     http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.

require 'spec_helper'
require 'stringio'
require 'logger'

module AWS
  module SessionStore
    module DynamoDB
      describe Table do
        context "Mock Table Methods Tests", :integration => true do
          let(:table_name) { "sessionstore-integration-test-#{Time.now.to_i}" }
          let(:options) { {:table_name => table_name} }
          let(:io) { StringIO.new }

          before { Table.stub(:logger) { Logger.new(io) } }

          it "Creates and deletes a new table" do
            Table.create_table(options)

            # second attempt should warn
            Table.create_table(options)

            io.string.should include("Table #{table_name} created, waiting for activation...\n")
            io.string.should include("Table #{table_name} is now ready to use.\n")
            io.string.should include("Table #{table_name} already exists, skipping creation.\n")

            # now delete table
            Table.delete_table(options)
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
aws-sessionstore-dynamodb-0.5.1 spec/aws/session_store/dynamo_db/table_spec.rb
aws-sessionstore-dynamodb-0.5.0 spec/aws/session_store/dynamo_db/table_spec.rb