inline_tests 1.0.1 → 1.0.2
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/inline_tests.rb +9 -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: aabc80d88b58884367f206fb948310569b1fb749ca02502ee8eab2134796087e
|
4
|
+
data.tar.gz: d72ec949930e7dd4defa37adf0a9ec2b704f31b266e4388a5502eb7d77128e7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ebb5d820fb13dfc3b769dd0f79b35ae6580144ed604ac452d484c1b18f4b8c546759c1e73fe583af52ac3f67090b63f12d5f807e61976f488239090d72f2a70
|
7
|
+
data.tar.gz: 13104f7a6e153d809109db370ebd44e9b6708f30abe4093a5970bc90326e96ee3c2454bbcdf30480f2a73dcc493565b19d0361a27f00263ae0b970b8aad869c2
|
data/lib/inline_tests.rb
CHANGED
@@ -8,6 +8,15 @@ class InlineTests
|
|
8
8
|
test_passes = 0
|
9
9
|
test_fails = 0
|
10
10
|
|
11
|
+
# If we're a gem in a library like Rails that loads models on demand,
|
12
|
+
# we need to make sure all the models are loaded before running any tests,
|
13
|
+
# because it's the loading of the models that registers each method's tests.
|
14
|
+
begin
|
15
|
+
Rails.application.eager_load!
|
16
|
+
rescue
|
17
|
+
# TODO: handle/display any Railsy errors here
|
18
|
+
end
|
19
|
+
|
11
20
|
puts "Starting inline test suite:"
|
12
21
|
all_tests_start_time = Time.now
|
13
22
|
METHODS_WITH_INLINE_TESTS.each do |method|
|