summaryrefslogtreecommitdiff
path: root/spec/acceptance/ensure_resource_spec.rb
blob: 93f25ddc0ee6633cc55c162edf3890bb8c935fd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#! /usr/bin/env ruby -S rspec
require 'spec_helper_acceptance'

describe 'ensure_resource function' do
  describe 'success' do
    it 'ensures a resource already declared' do
      apply_manifest('')
      pp = <<-EOS
      notify { "test": loglevel => 'err' }
      ensure_resource('notify', 'test', { 'loglevel' => 'err' })
      EOS

      apply_manifest(pp, :expect_changes => true)
    end

    it 'ensures a undeclared resource' do
      apply_manifest('')
      pp = <<-EOS
      ensure_resource('notify', 'test', { 'loglevel' => 'err' })
      EOS

      apply_manifest(pp, :expect_changes => true)
    end
    it 'takes defaults arguments'
  end
  describe 'failure' do
    it 'handles no arguments'
    it 'handles non strings'
  end
end