Skip to content

Commit

Permalink
Merge pull request #536 from rodjek/pdk-1061
Browse files Browse the repository at this point in the history
(PDK-1061) Ensure rake binstub when building module
  • Loading branch information
scotje committed Jul 3, 2018
2 parents 266df9c + fd03949 commit 080f95a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/pdk/module/build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ def cleanup_build_dir
#
# @return nil
def cleanup_module
PDK::Util::Bundler.ensure_bundle!
PDK::Util::Bundler.ensure_binstubs!('rake')

PDK::Test::Unit.tear_down
end

Expand Down
16 changes: 16 additions & 0 deletions spec/unit/pdk/module/build_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -344,4 +344,20 @@
end
end
end

describe '#cleanup_module' do
subject(:instance) { described_class.new(module_dir: module_dir) }

let(:module_dir) { File.join(root_dir, 'tmp', 'my-module') }

after(:each) do
instance.cleanup_module
end

it 'ensures the rake binstub is present before cleaning up spec fixtures' do
expect(PDK::Util::Bundler).to receive(:ensure_bundle!).ordered
expect(PDK::Util::Bundler).to receive(:ensure_binstubs!).with('rake').ordered
expect(PDK::Test::Unit).to receive(:tear_down).ordered
end
end
end

0 comments on commit 080f95a

Please sign in to comment.