Sha256: 14f84469c0fef46618052d682d177567e8851ac3a21899b03d6481625459f641

Contents?: true

Size: 643 Bytes

Versions: 1

Compression:

Stored size: 643 Bytes

Contents

require 'minitest/autorun'
require './lib/amazon_athena/commands/show_table_properties'

describe AmazonAthena::Commands::ShowTableProperties do

  before do
    @cmd = AmazonAthena::Commands::ShowTableProperties.new("mydb.mytable")
  end

  it "provides a db statement" do
    assert_equal "SHOW TBLPROPERTIES mydb.mytable;", @cmd.statement
  end

  it "executes a query" do
    text = "EXTERNAL\tTRUE\ntransient_lastDdlTime\t1488319092"

    results = MiniTest::Mock.new
    results.expect(:raw_output, text)

    conn = MiniTest::Mock.new
    conn.expect(:query, results, ["SHOW TBLPROPERTIES mydb.mytable;"])

    @cmd.run(conn)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
athena-cli-0.1.0 test/lib/amazon_athena/commands/show_table_properties_test.rb