newer pg module
[mirror/dsa-puppet.git] / 3rdparty / modules / postgresql / spec / unit / functions / postgresql_escape_spec.rb
diff --git a/3rdparty/modules/postgresql/spec/unit/functions/postgresql_escape_spec.rb b/3rdparty/modules/postgresql/spec/unit/functions/postgresql_escape_spec.rb
new file mode 100644 (file)
index 0000000..b4c9488
--- /dev/null
@@ -0,0 +1,14 @@
+require 'spec_helper'
+
+describe 'postgresql_escape', :type => :puppet_function do
+  it { is_expected.to run.with_params('foo').
+    and_return('$$foo$$') }
+end
+describe 'postgresql_escape', :type => :puppet_function do
+  it { is_expected.to run.with_params('fo$$o').
+    and_return('$ed$fo$$o$ed$') }
+end
+describe 'postgresql_escape', :type => :puppet_function do
+  it { is_expected.to run.with_params('foo$').
+    and_return('$a$foo$$a$') }
+end