Skip to content

Commit ccea1a6

Browse files
Enable bootsnap test
Co-Authored-By: Ricardo Trindade <[email protected]>
1 parent c7f0f34 commit ccea1a6

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,4 @@ Gemfile.lock
4141

4242
## Tests
4343
/spec/examples.txt
44+
/spec/fixtures/test/tmp/cache

lib/dry/system/plugins/bootsnap.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ module Plugins
66
module Bootsnap
77
DEFAULT_OPTIONS = {
88
load_path_cache: true,
9-
disable_trace: true,
109
compile_cache_iseq: true,
1110
compile_cache_yaml: true,
1211
autoload_paths_cache: false
@@ -32,7 +31,7 @@ def self.dependencies
3231
def setup_bootsnap
3332
return unless bootsnap_available?
3433

35-
::Bootsnap.setup(config.bootsnap.merge(cache_dir: root.join("tmp/cache").to_s))
34+
::Bootsnap.setup(**config.bootsnap, cache_dir: root.join("tmp/cache").to_s)
3635
end
3736

3837
# @api private

spec/integration/container/plugins/bootsnap_spec.rb

+12-2
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,30 @@
88
configure do |config|
99
config.root = SPEC_ROOT.join("fixtures/test")
1010
config.env = :development
11+
config.bootsnap = {
12+
load_path_cache: false,
13+
compile_cache_iseq: true,
14+
compile_cache_yaml: true,
15+
autoload_paths_cache: false
16+
}
1117
end
1218
end
1319
end
1420

1521
let(:bootsnap_cache_file) do
16-
system.root.join("tmp/cache/bootsnap-load-path-cache")
22+
system.root.join("tmp/cache/bootsnap-compile-cache")
23+
end
24+
25+
before do
26+
FileUtils.rm_r(system.root.join("tmp/cache"))
1727
end
1828

1929
after do
2030
FileUtils.rm_r(system.root.join("tmp/cache"))
2131
end
2232

2333
describe ".require_from_root" do
24-
xit "loads file" do
34+
it "loads file" do
2535
system.require_from_root("lib/test/models")
2636

2737
expect(Object.const_defined?("Test::Models")).to be(true)

0 commit comments

Comments
 (0)