@@ -73,8 +73,28 @@ def test_tablespace_trigger_based
7373 assert_period "month" , trigger_based : true , tablespace : true
7474 end
7575
76+ def test_prep_missing_arguments
77+ assert_error %!Usage: "pgslice prep TABLE COLUMN PERIOD"! , "prep Posts createdAt"
78+ end
79+
7680 def test_prep_missing_table
77- assert_error "Table not found" , "prep Items"
81+ assert_error "Table not found" , "prep Items createdAt day"
82+ end
83+
84+ def test_prep_missing_column
85+ assert_error "Column not found" , "prep Posts created day"
86+ end
87+
88+ def test_prep_invalid_period
89+ assert_error "Invalid period" , "prep Posts createdAt decade"
90+ end
91+
92+ def test_prep_no_partition_extra_arguments
93+ assert_error %!Usage: "pgslice prep TABLE --no-partition"! , "prep Posts createdAt --no-partition"
94+ end
95+
96+ def test_prep_no_partition_trigger_based
97+ assert_error "Can't use --trigger-based and --no-partition" , "prep Posts --no-partition --trigger-based"
7898 end
7999
80100 def test_add_partitions_missing_table
@@ -294,7 +314,7 @@ def primary_key(table_name)
294314
295315 def assert_primary_key ( table_name )
296316 result = primary_key ( table_name )
297- assert_match " PRIMARY KEY (\ " Id\" )" , result [ "def" ]
317+ assert_match %! PRIMARY KEY ("Id")! , result [ "def" ]
298318 end
299319
300320 def refute_primary_key ( table_name )
0 commit comments