[Groonga-commit] ranguba/groonga-client-model at 37248e9 [master] test: add #bool alias test

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Mar 6 11:28:09 JST 2017


Kouhei Sutou	2017-03-06 11:28:09 +0900 (Mon, 06 Mar 2017)

  New Revision: 37248e9b1fdd012566f7f351b8b07760f6e53f15
  https://github.com/ranguba/groonga-client-model/commit/37248e9b1fdd012566f7f351b8b07760f6e53f15

  Message:
    test: add #bool alias test

  Modified files:
    test/unit/migration/test_create_table.rb

  Modified: test/unit/migration/test_create_table.rb (+26 -0)
===================================================================
--- test/unit/migration/test_create_table.rb    2017-03-06 11:25:44 +0900 (1983744)
+++ test/unit/migration/test_create_table.rb    2017-03-06 11:28:09 +0900 (52c8143)
@@ -158,6 +158,32 @@ column_create posts published COLUMN_SCALAR Bool
           end
         end
       end
+
+      test("#bool alias") do
+        expected_up_report = <<-REPORT
+-- create_table(:posts, {:type=>"TABLE_NO_KEY"})
+   -> 0.0s
+-- add_column(:posts, :published, {:flags=>["COLUMN_SCALAR"], :value_type=>"Bool"})
+   -> 0.0s
+        REPORT
+        expected_down_report = <<-REPORT
+-- remove_table(:posts)
+   -> 0.0s
+        REPORT
+        expected_dump = <<-DUMP.chomp
+table_create posts TABLE_NO_KEY
+column_create posts published COLUMN_SCALAR Bool
+        DUMP
+        assert_migrate(expected_up_report,
+                       expected_down_report,
+                       expected_dump) do |migration|
+          migration.instance_eval do
+            create_table(:posts) do |table|
+              table.bool(:published)
+            end
+          end
+        end
+      end
     end
 
     sub_test_case("#short_text") do
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index