source: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/dirname_spec.rb@ 30960

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

Switch to using Puppet to provision machine. Strongly based on files developed for spark-hdfs cluster

  • Property svn:executable set to *
File size: 1.1 KB
Line 
1#! /usr/bin/env ruby -S rspec
2require 'spec_helper_acceptance'
3
4describe 'dirname function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
5 describe 'success' do
6 context 'absolute path' do
7 it 'returns the dirname' do
8 pp = <<-EOS
9 $a = '/path/to/a/file.txt'
10 $b = '/path/to/a'
11 $o = dirname($a)
12 if $o == $b {
13 notify { 'output correct': }
14 }
15 EOS
16
17 apply_manifest(pp, :catch_failures => true) do |r|
18 expect(r.stdout).to match(/Notice: output correct/)
19 end
20 end
21 end
22 context 'relative path' do
23 it 'returns the dirname' do
24 pp = <<-EOS
25 $a = 'path/to/a/file.txt'
26 $b = 'path/to/a'
27 $o = dirname($a)
28 if $o == $b {
29 notify { 'output correct': }
30 }
31 EOS
32
33 apply_manifest(pp, :catch_failures => true) do |r|
34 expect(r.stdout).to match(/Notice: output correct/)
35 end
36 end
37 end
38 end
39 describe 'failure' do
40 it 'handles improper argument counts'
41 end
42end
Note: See TracBrowser for help on using the repository browser.