Skip to content

Commit fd9422d

Browse files
alexjfisherAlex Fisher
authored and
Alex Fisher
committed
Fix filenames of two function spec tests
The tests weren't being run. Total tests increase from 2742 to 2769. Also fix 'when using a class extending String' test. It had been failing with... ``` RuntimeError: can't modify frozen AlsoString ```
1 parent 5a17bf1 commit fd9422d

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

lib/puppet/functions/length.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
dispatch :length do
44
param 'Variant[String,Array,Hash]', :value
55
end
6-
def length(value)
6+
def length(value)
77
if value.is_a?(String)
88
result = value.length
99
elsif value.is_a?(Array) || value.is_a?(Hash)

spec/functions/length.rb renamed to spec/functions/length_spec.rb

+1-5
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@
2626
it { is_expected.to run.with_params('āβćđ').and_return(4) }
2727

2828
context 'when using a class extending String' do
29-
it 'should call its size method' do
30-
value = AlsoString.new('asdfghjkl')
31-
value.expects(:length).returns('foo')
32-
expect(subject).to run.with_params(value).and_return('foo')
33-
end
29+
it { is_expected.to run.with_params(AlsoString.new('asdfghjkl')).and_return(9) }
3430
end
3531
end

0 commit comments

Comments
 (0)