source: other-projects/hathitrust/vagrant-hadoop-cluster/trunk/modules/stdlib/spec/acceptance/unique_spec.rb@ 30903

Last change on this file since 30903 was 30903, checked in by davidb, 7 years ago

Vagrant provisioning files for a 4-node Hadoop cluster. See README.txt for more details

  • Property svn:executable set to *
File size: 1010 bytes
Line 
1#! /usr/bin/env ruby -S rspec
2require 'spec_helper_acceptance'
3
4describe 'unique function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
5 describe 'success' do
6 it 'uniques arrays' do
7 pp = <<-EOS
8 $a = ["wallless", "wallless", "brrr", "goddessship"]
9 $o = unique($a)
10 notice(inline_template('unique is <%= @o.inspect %>'))
11 EOS
12
13 apply_manifest(pp, :catch_failures => true) do |r|
14 expect(r.stdout).to match(/unique is \["wallless", "brrr", "goddessship"\]/)
15 end
16 end
17 it 'uniques strings' do
18 pp = <<-EOS
19 $a = "wallless laparohysterosalpingooophorectomy brrr goddessship"
20 $o = unique($a)
21 notice(inline_template('unique is <%= @o.inspect %>'))
22 EOS
23
24 apply_manifest(pp, :catch_failures => true) do |r|
25 expect(r.stdout).to match(/unique is "wales prohytingcmbd"/)
26 end
27 end
28 end
29 describe 'failure' do
30 it 'handles no arguments'
31 it 'handles non strings or arrays'
32 end
33end
Note: See TracBrowser for help on using the repository browser.