squcumber-redshift 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Nzk4NGE2ZWNiNDQ3MmJkNDI4MjJjZjRlNTlmNjEzN2M3MDAzMDFiMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MGRjZGYzNzYyZGZhZWJlYzlmNWQ3ZWZjMDRiZDQwNDU0YmY3NWYwZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTQ0MmMwNmU4N2FmMDJjZjlhZmMyNjY3YjczMTk1YzBjN2IzOGVlMmY5NTFk
|
10
|
+
ZmVmNmNjOGVlYWUyODRkNmFkOTdjOTM1OWY1ZDVlOTA5Nzg0N2QxYzYwZDUx
|
11
|
+
NDZiNDljY2QxYmJiNDc3NTVjMzc1MGI4MTBiYjBhYmMxYzVkYmY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YjA4NTY1ZTkyNTlkMzhhMjRkZjMxY2M5OWU4NGE3ZDIyNTk3NzU4NzIzYmVh
|
14
|
+
ZGQ0ZDdlMWE3MzIzYTgyNWJhYWJjNGRhODRlYTU4ZGE1ZWYzNDkwODlhMDI4
|
15
|
+
NjYxZjYzNDc3NDNkZjgyOWFjMjY4ODAwNDQ3MjQwY2RlNmJkYjM=
|
@@ -28,7 +28,10 @@ module Squcumber
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def setup(schemas)
|
31
|
-
schemas.each
|
31
|
+
schemas.each do |schema|
|
32
|
+
exec("drop schema if exists #{schema} cascade")
|
33
|
+
exec("create schema #{schema}")
|
34
|
+
end
|
32
35
|
end
|
33
36
|
|
34
37
|
def truncate_all_tables
|
@@ -1,7 +1,14 @@
|
|
1
1
|
require 'json'
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
$feature_name ||= ''
|
4
|
+
$setup ||= false
|
5
|
+
|
6
|
+
Before do |scenario|
|
7
|
+
current_scenario_name = scenario.feature.name rescue nil
|
8
|
+
if current_scenario_name != $feature_name
|
9
|
+
$feature_name = current_scenario_name
|
10
|
+
$setup = false
|
11
|
+
end
|
5
12
|
end
|
6
13
|
|
7
14
|
# Takes a path and then sequentially adds what's provided in `data`
|
@@ -155,6 +155,23 @@ module Squcumber::Redshift::Mock
|
|
155
155
|
end
|
156
156
|
end
|
157
157
|
|
158
|
+
describe '#setup' do
|
159
|
+
let(:schemas) { ['some_schema', 'another_schema'] }
|
160
|
+
|
161
|
+
before(:each) do
|
162
|
+
@dummy = described_class.new(production_database)
|
163
|
+
allow(@dummy).to receive(:exec)
|
164
|
+
@dummy.setup(schemas)
|
165
|
+
end
|
166
|
+
|
167
|
+
it 'drops and creates all schemas' do
|
168
|
+
expect(@dummy).to have_received(:exec).with('drop schema if exists some_schema cascade').ordered
|
169
|
+
expect(@dummy).to have_received(:exec).with('create schema some_schema').ordered
|
170
|
+
expect(@dummy).to have_received(:exec).with('drop schema if exists another_schema cascade').ordered
|
171
|
+
expect(@dummy).to have_received(:exec).with('create schema another_schema').ordered
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
158
175
|
describe '#truncate_all_tables' do
|
159
176
|
let(:existing_tables) { ['some_schema.some_table', 'some_other_schema.some_other_table'] }
|
160
177
|
|