Skip to content

(GH-1262) Use 'require_relative' to load stdlib due to lookup errors #1264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/puppet_x/stdlib/toml_dumper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

require 'puppet_x/stdlib'
require_relative '../stdlib'
require 'date'

module PuppetX::Stdlib
Expand Down
6 changes: 3 additions & 3 deletions spec/functions/loadjson_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
let(:json) { '{"key":"value", {"ķęŷ":"νậŀųề" }, {"キー":"値" }' }

it {
expect(OpenURI).to receive(:open_uri).with(filename).and_return(json)
expect(OpenURI).to receive(:open_uri).with(filename, {}).and_return(json)
expect(PSON).to receive(:load).with(json).and_return(data).once
is_expected.to run.with_params(filename).and_return(data)
}
Expand Down Expand Up @@ -125,7 +125,7 @@
let(:json) { ',;{"key":"value"}' }

it {
expect(OpenURI).to receive(:open_uri).with(filename).and_return(json)
expect(OpenURI).to receive(:open_uri).with(filename, {}).and_return(json)
expect(PSON).to receive(:load).with(json).once.and_raise StandardError, 'Something terrible have happened!'
is_expected.to run.with_params(filename, 'default' => 'value').and_return('default' => 'value')
}
Expand All @@ -137,7 +137,7 @@
end

it {
expect(OpenURI).to receive(:open_uri).with(filename).and_raise OpenURI::HTTPError, '404 File not Found'
expect(OpenURI).to receive(:open_uri).with(filename, {}).and_raise OpenURI::HTTPError, '404 File not Found'
is_expected.to run.with_params(filename, 'default' => 'value').and_return('default' => 'value')
}
end
Expand Down