postgresql_python_spec.rb 921 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. require 'spec_helper'
  2. describe 'postgresql::python', :type => :class do
  3. describe 'on a redhat based os' do
  4. let :facts do {
  5. :osfamily => 'RedHat',
  6. :postgres_default_version => 'foo',
  7. }
  8. end
  9. it { should contain_package('python-psycopg2').with(
  10. :name => 'python-psycopg2',
  11. :ensure => 'present'
  12. )}
  13. end
  14. describe 'on a debian based os' do
  15. let :facts do {
  16. :osfamily => 'Debian',
  17. :postgres_default_version => 'foo',
  18. }
  19. end
  20. it { should contain_package('python-psycopg2').with(
  21. :name => 'python-psycopg2',
  22. :ensure => 'present'
  23. )}
  24. end
  25. describe 'on any other os' do
  26. let :facts do {
  27. :osfamily => 'foo',
  28. :postgres_default_version => 'foo',
  29. }
  30. end
  31. it 'should fail' do
  32. expect { subject }.to raise_error(/Unsupported osfamily: foo/)
  33. end
  34. end
  35. end