Skip to content

Commit

Permalink
Drop the table in teardown
Browse files Browse the repository at this point in the history
If the assertion fails, drop sentence was not executed.
  • Loading branch information
tomykaira committed Mar 16, 2012
1 parent c37bfb1 commit 2126411
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions test/test_ext.rb
Expand Up @@ -9,6 +9,9 @@ class TestExt < Test::Unit::TestCase
@ft.clientlogin(username, password)
end

teardown do
@ft.drop(@table.id) if @table and @table.id
end

should "raise ArgumentError if supply unknown types to it" do
assert_raise ArgumentError do
Expand All @@ -17,15 +20,13 @@ class TestExt < Test::Unit::TestCase
end

should "let you create a table if you get everything right" do
table = @ft.create_table "test_table", [{:name => "test_col", :type => "string" }]
assert_equal GData::Client::FusionTables::Table, table.class
@ft.drop(table.id)
@table = @ft.create_table "test_table", [{:name => "test_col", :type => "string" }]
assert_equal GData::Client::FusionTables::Table, @table.class
end

should "correct your table name to a certain degree on create" do
table = @ft.create_table "test table", [{:name => "test col", :type => "string" }]
assert_equal "test_table", table.name
@ft.drop(table.id)
@table = @ft.create_table "test table", [{:name => "test col", :type => "string" }]
assert_equal "test_table", @table.name
end

should "return you a list of your fusion tables" do
Expand Down

0 comments on commit 2126411

Please sign in to comment.