aboutsummaryrefslogtreecommitdiffstats
path: root/spec/support
diff options
context:
space:
mode:
authorRobert2017-04-19 13:24:31 +0200
committerRobert2017-04-19 13:24:31 +0200
commitf18d0a349eeec0822c02b08bbee276398aa40975 (patch)
tree7acdb75528e189978f49a3c46f1b751d9ed1cd1a /spec/support
parent45da531345ce04ae388465d8bb5bb7a092a7b2e2 (diff)
downloadchouette-core-f18d0a349eeec0822c02b08bbee276398aa40975.tar.bz2
filtered environment specific information from pg_catalog (spec support)
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/pg_catalog.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/support/pg_catalog.rb b/spec/support/pg_catalog.rb
index dd0219482..30992168e 100644
--- a/spec/support/pg_catalog.rb
+++ b/spec/support/pg_catalog.rb
@@ -31,6 +31,7 @@ module Support
def get_table_information(schema_name, table_name)
execute("SELECT * FROM information_schema.tables WHERE table_name = '#{table_name}' AND table_schema = '#{schema_name}'")
.to_a
+ .map(&without_keys("table_catalog"))
end
@@ -69,5 +70,13 @@ module Support
def queries
@__queries__ ||= {}
end
+
+ def without_keys(*keys)
+ -> hashy do
+ hashy.inject({}) do |h, (k,v)|
+ keys.include?(k) ? h : h.merge(k => v)
+ end
+ end
+ end
end
end