aidy
1
Hi,
I have an options hash map as a run method’s second parameter
I am currently doing this
run File.join(File.dirname(FILE), “…/projects/#{filename}”, {"-
fh:" => “C:/rspec_reports/#{filename}.htm”})
But I am recieving this error
`join’: can’t convert Hash into String (TypeError)
Could anyone give me the correct syntax please?
Aidy
aidy
2
aidy wrote:
Hi,
I have an options hash map as a run method’s second parameter
I am currently doing this
run File.join(File.dirname(FILE), “…/projects/#{filename}”, {"-
fh:" => “C:/rspec_reports/#{filename}.htm”})
But I am recieving this error
`join’: can’t convert Hash into String (TypeError)
Could anyone give me the correct syntax please?
Aidy
Try this:
run File.join(File.dirname(FILE), “…/projects/#{filename}”, “-
fh: => C:/rspec_reports/#{filename}.htm”)
aidy
3
I have an options hash map as a run method’s second parameter
run File.join(File.dirname(FILE), “…/projects/#{filename}”, {"-
fh:" => “C:/rspec_reports/#{filename}.htm”})
Aidy, you call the run method with only one parameter, the result of
File.join. The hash is the third parameter to File.join.
Regards,
Pit