summaryrefslogtreecommitdiff
path: root/spec/acceptance/keys_spec.rb
blob: 65bfe28719794f5afd3209a737d2a153ae83b77f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#! /usr/bin/env ruby -S rspec
require 'spec_helper_acceptance'

describe 'keys function' do
  describe 'success' do
    it 'keyss hashes' do
      pp = <<-EOS
      $a = {'aaa'=>'bbb','ccc'=>'ddd'}
      $o = keys($a)
      notice(inline_template('keys is <%= @o.sort.inspect %>'))
      EOS

      apply_manifest(pp, :catch_failures => true) do |r|
        expect(r.stdout).to match(/keys is \["aaa", "ccc"\]/)
      end
    end
    it 'handles non hashes'
    it 'handles empty hashes'
  end
  describe 'failure' do
    it 'handles improper argument counts'
  end
end