forest_liana 9.17.6 → 9.17.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/forest_liana/engine.rb +5 -1
- data/lib/forest_liana/version.rb +1 -1
- data/spec/lib/forest_liana/engine_spec.rb +18 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 55b4065b5a2334f7fec593dbb43d62558fcd2786cde6765ba60099c3c3ff0b03
|
|
4
|
+
data.tar.gz: ec40d991bf17242d482846b8c2495b4747b0cf590c7a77031624af333b5dbb5a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 90d60f43668a322d66005702e3b079a751d979e65157265cf70ab2bfe1a56f873c9a5cf717cdbadcda75b0d503ef5a237f7b634a1a6e1245314268c41aa23b3f
|
|
7
|
+
data.tar.gz: 9fa2bbce56a9db1ee0ed6fbf62eee6e455d167b8c7f4235fe111fa7c1fdc394f6365c13c10e0db2b2dea1e59144d1489fd9c95a1cfd923c42f0b7ff91a5c3c7c
|
data/lib/forest_liana/engine.rb
CHANGED
|
@@ -64,7 +64,11 @@ module ForestLiana
|
|
|
64
64
|
# models mid-migration (crashing on enums backed by a pending column).
|
|
65
65
|
return true if File.basename($0) == 'rake'
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
# NOTICE: `respond_to?` guard — the Rake constant can be defined with only a
|
|
68
|
+
# partial load (Rails' test_unit requires rake/file_list), leaving
|
|
69
|
+
# Rake.application undefined and crashing boot.
|
|
70
|
+
defined?(Rake) && Rake.respond_to?(:application) &&
|
|
71
|
+
Rake.application.top_level_tasks.any? { |task| task != 'default' }
|
|
68
72
|
end
|
|
69
73
|
|
|
70
74
|
def database_available?
|
data/lib/forest_liana/version.rb
CHANGED
|
@@ -45,6 +45,24 @@ module ForestLiana
|
|
|
45
45
|
expect(engine.rake?).to be(false)
|
|
46
46
|
end
|
|
47
47
|
end
|
|
48
|
+
|
|
49
|
+
context 'when Rake is only partially loaded (Rake constant defined without Rake.application)' do
|
|
50
|
+
# Reproduces the boot crash: Rails' test_unit integration requires
|
|
51
|
+
# `rake/file_list`, which defines the Rake module without loading
|
|
52
|
+
# rake/application. `defined?(Rake)` is then truthy but `Rake.application`
|
|
53
|
+
# is undefined, so the old guard raised NoMethodError at boot.
|
|
54
|
+
it 'returns false instead of raising NoMethodError' do
|
|
55
|
+
$0 = '/usr/local/bin/rails'
|
|
56
|
+
allow(Rake).to receive(:respond_to?).and_call_original
|
|
57
|
+
allow(Rake).to receive(:respond_to?).with(:application).and_return(false)
|
|
58
|
+
allow(Rake).to receive(:application).and_raise(
|
|
59
|
+
NoMethodError.new("undefined method 'application' for module Rake")
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
expect { engine.rake? }.not_to raise_error
|
|
63
|
+
expect(engine.rake?).to be(false)
|
|
64
|
+
end
|
|
65
|
+
end
|
|
48
66
|
end
|
|
49
67
|
end
|
|
50
68
|
end
|