summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/aliases/absolutepath_spec.rb50
-rwxr-xr-xspec/functions/is_function_available_spec.rb (renamed from spec/functions/is_function_available.rb)0
-rwxr-xr-xspec/functions/length_spec.rb (renamed from spec/functions/length.rb)6
3 files changed, 1 insertions, 55 deletions
diff --git a/spec/aliases/absolutepath_spec.rb b/spec/aliases/absolutepath_spec.rb
deleted file mode 100644
index ff23dc0..0000000
--- a/spec/aliases/absolutepath_spec.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-require 'spec_helper'
-
-if Puppet::Util::Package.versioncmp(Puppet.version, '4.5.0') >= 0
- describe 'test::absolutepath', type: :class do
- describe 'valid handling' do
- %w{
- /usr2/username/bin:/usr/local/bin:/usr/bin:.
- C:/
- C:\\
- C:\\WINDOWS\\System32
- C:/windows/system32
- X:/foo/bar
- X:\\foo\\bar
- \\\\host\\windows
- //host/windows
- /var/tmp
- /var/opt/../lib/puppet
- /var/opt//lib/puppet
- }.each do |value|
- describe value.inspect do
- let(:params) {{ value: value }}
- it { is_expected.to compile }
- end
- end
- end
-
- describe 'invalid path handling' do
- context 'garbage inputs' do
- [
- nil,
- [ nil ],
- [ nil, nil ],
- { 'foo' => 'bar' },
- { },
- '',
- "*/Users//nope",
- "\\Users/hc/wksp/stdlib",
- "C:noslashes",
- "\\var\\tmp"
- ].each do |value|
- describe value.inspect do
- let(:params) {{ value: value }}
- it { is_expected.to compile.and_raise_error(/parameter 'value' expects a match for.*Variant/) }
- end
- end
- end
-
- end
- end
-end
diff --git a/spec/functions/is_function_available.rb b/spec/functions/is_function_available_spec.rb
index 44f08c0..44f08c0 100755
--- a/spec/functions/is_function_available.rb
+++ b/spec/functions/is_function_available_spec.rb
diff --git a/spec/functions/length.rb b/spec/functions/length_spec.rb
index d1ab003..487cf21 100755
--- a/spec/functions/length.rb
+++ b/spec/functions/length_spec.rb
@@ -26,10 +26,6 @@ describe 'length' do
it { is_expected.to run.with_params('āβćđ').and_return(4) }
context 'when using a class extending String' do
- it 'should call its size method' do
- value = AlsoString.new('asdfghjkl')
- value.expects(:length).returns('foo')
- expect(subject).to run.with_params(value).and_return('foo')
- end
+ it { is_expected.to run.with_params(AlsoString.new('asdfghjkl')).and_return(9) }
end
end