]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - 3rdparty/modules/keystone/spec/unit/type/keystone_user_spec.rb
Update to Kilo
[dsa-puppet.git] / 3rdparty / modules / keystone / spec / unit / type / keystone_user_spec.rb
diff --git a/3rdparty/modules/keystone/spec/unit/type/keystone_user_spec.rb b/3rdparty/modules/keystone/spec/unit/type/keystone_user_spec.rb
new file mode 100644 (file)
index 0000000..789af43
--- /dev/null
@@ -0,0 +1,25 @@
+require 'spec_helper'
+require 'puppet'
+require 'puppet/type/keystone_user'
+
+describe Puppet::Type.type(:keystone_user) do
+
+  before :each do
+    @project = Puppet::Type.type(:keystone_user).new(
+    :name   => 'foo',
+    :domain => 'foo-domain',
+    )
+
+    @domain = @project.parameter('domain')
+  end
+
+  it 'should not be in sync for domain changes' do
+    expect { @domain.insync?('not-the-domain') }.to raise_error(Puppet::Error, /The domain cannot be changed from/)
+    expect { @domain.insync?(nil) }.to raise_error(Puppet::Error, /The domain cannot be changed from/)
+  end
+
+  it 'should be in sync if domain is the same' do
+    expect(@domain.insync?('foo-domain')).to be true
+  end
+
+end