Skip to content

Commit

Permalink
Fixed different behavior of Dir::Tmpname.create after ruby-2.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
david942j committed Apr 2, 2018
1 parent 1524ab6 commit 91bcba1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions spec/update_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@

describe OneGadget::Update do
before(:all) do
@tmpdir = File.join(Dir.tmpdir, 'one_gadget')
FileUtils.mkdir_p(@tmpdir)
# prevent failing on CI
@hook_cache_file = lambda do |&block|
Dir::Tmpname.create('one_gadget/update') do |tmp|
Dir::Tmpname.create('update', @tmpdir) do |tmp|
stub_const('OneGadget::Update::CACHE_FILE', tmp)
block.call(tmp)
end
Expand All @@ -26,7 +28,7 @@
end

after(:all) do
FileUtils.rm_r(File.join(Dir.tmpdir, 'one_gadget'))
FileUtils.rm_r(@tmpdir)
end

it 'cache_file' do
Expand Down

0 comments on commit 91bcba1

Please sign in to comment.