Sha256: fe90db7c9b4ae298b268b24486f699306b84851dc3887b761fc972023686e940

Contents?: true

Size: 933 Bytes

Versions: 3

Compression:

Stored size: 933 Bytes

Contents

require File.join(File.dirname(__FILE__), 'helper')
class DescribeTest < Test::Unit::TestCase
  context "Given a table and some data" do
    setup do
      @client = Oci8Simple::Client.new("test")
      @client.run "DROP TABLE OCI8_SIMPLE_TEST CASCADE CONSTRAINTS" rescue nil
      @client.run <<-SQL
        CREATE TABLE "OCI8_SIMPLE_TEST"
          (
            "NAME"           VARCHAR2(400 CHAR) NOT NULL ENABLE,
            "ID"             NUMBER(38,0) NOT NULL ENABLE,
            "TEXTS"          CLOB
          )
      SQL
      @describe = Oci8Simple::Describe.new("test")
    end
    context "describing a table" do
      setup do
      end
      should "format results for the command line" do
        expected=<<-STR
"ID"    NUMBER(38)         NOT NULL
"NAME"  VARCHAR2(400 CHAR) NOT NULL
"TEXTS" CLOB               
STR
        assert_equal(expected.chop, @describe.run("oci8_simple_test"))
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
oci8_simple-0.4.2 test/describe_test.rb
oci8_simple-0.4.1 test/describe_test.rb
oci8_simple-0.4.0 test/describe_test.rb