Skip to content

Commit af84845

Browse files
authored
Merge pull request #1264 from david22swan/GH-1262/main
(GH-1262) Use 'require_relative' to load stdlib due to lookup errors
2 parents 382236c + 288b669 commit af84845

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/puppet_x/stdlib/toml_dumper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1919
# THE SOFTWARE.
2020

21-
require 'puppet_x/stdlib'
21+
require_relative '../stdlib'
2222
require 'date'
2323

2424
module PuppetX::Stdlib

spec/functions/loadjson_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
let(:json) { '{"key":"value", {"ķęŷ":"νậŀųề" }, {"キー":"値" }' }
8181

8282
it {
83-
expect(OpenURI).to receive(:open_uri).with(filename).and_return(json)
83+
expect(OpenURI).to receive(:open_uri).with(filename, {}).and_return(json)
8484
expect(PSON).to receive(:load).with(json).and_return(data).once
8585
is_expected.to run.with_params(filename).and_return(data)
8686
}
@@ -125,7 +125,7 @@
125125
let(:json) { ',;{"key":"value"}' }
126126

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

139139
it {
140-
expect(OpenURI).to receive(:open_uri).with(filename).and_raise OpenURI::HTTPError, '404 File not Found'
140+
expect(OpenURI).to receive(:open_uri).with(filename, {}).and_raise OpenURI::HTTPError, '404 File not Found'
141141
is_expected.to run.with_params(filename, 'default' => 'value').and_return('default' => 'value')
142142
}
143143
end

0 commit comments

Comments
 (0)