Skip to content

Commit

Permalink
Two broken tests. WTF.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielparks committed Sep 29, 2022
1 parent 74185da commit e18c86f
Showing 1 changed file with 22 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,18 @@

describe 'parsing a function with a doc parameter' do
let(:source) { <<~'SOURCE' }
Puppet::Parser::Functions.newfunction(:foo, doc: <<-DOC
An example 3.x function.
@param [String] first The first parameter.
@param second The second parameter.
@return [Undef] Returns nothing.
DOC
) do |*args|
Puppet::Parser::Functions.newfunction(:foo, doc: <<~'DOC') do |*args|
An example 3.x function.
@param [String] first The first parameter.
@param second The second parameter.
@return [Undef] Returns nothing.
DOC
# ...
end
SOURCE

it 'registers a function object' do
skip('parse error: Putting `) do |*args|` on first line rather than after DOC causes docstring to be trimmed before parsing. The length of the "*args" variable name affects it.')
expect(spec_subject.size).to eq(1)
object = spec_subject.first
expect(object).to be_a(PuppetStrings::Yard::CodeObjects::Function)
Expand Down Expand Up @@ -73,18 +74,19 @@
describe 'parsing a function with a doc parameter which has a newline between the namespace and the newfunction call' do
let(:source) { <<~'SOURCE' }
module Puppet::Parser::Functions
newfunction(:foo, doc: <<-DOC
An example 3.x function.
@param [String] first The first parameter.
@param second The second parameter.
@return [Undef] Returns nothing.
DOC
) do |*args|
newfunction(:foo, doc: <<~'DOC') do |*args|
An example 3.x function.
@param [String] first The first parameter.
@param second The second parameter.
@return [Undef] Returns nothing.
DOC
# ...
end
end
SOURCE

it 'registers a function object' do
skip('parse error: Putting `) do |*args|` on first line rather than after DOC causes docstring to be trimmed before parsing. The length of the "*args" variable name affects it.')
expect(spec_subject.size).to eq(1)
object = spec_subject.first
expect(object).to be_a(PuppetStrings::Yard::CodeObjects::Function)
Expand Down Expand Up @@ -115,11 +117,12 @@ module Puppet::Parser::Functions

describe 'parsing a function with a missing @return tag' do
let(:source) { <<~'SOURCE' }
Puppet::Parser::Functions.newfunction(:foo, doc: <<-DOC) do |*args|
An example 3.x function.
@param [String] first The first parameter.
@param second The second parameter.
DOC
Puppet::Parser::Functions.newfunction(:foo, doc: <<~'DOC') do |*args|
An example 3.x function.
@param [String] first The first parameter.
@param second The second parameter.
DOC
# ...
end
SOURCE

Expand Down

0 comments on commit e18c86f

Please sign in to comment.