kapnismology 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -0
- data/lib/kapnismology/engine.rb +24 -22
- data/lib/kapnismology/evaluation_collection.rb +1 -1
- data/lib/kapnismology/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4339000a844a6c3f722b1980f8e70a5acc78f5e5
|
4
|
+
data.tar.gz: fb8b3a15c6d841d73b5f9d1198188e8e4e1aa572
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4de8ef415f02d7234ba102f235f1f9628822f531b130b7078ae19fc459f503b1a1de8ccfd9d67549be172af447e22a3c35b9b351fb1cf3ace851e52bfc09e954
|
7
|
+
data.tar.gz: 3ac836944d8c79fd3694b7f3f631c104d921d0df3e938e8c1aa898c921498e9f219b3d69af9fa97a9f3ce3577ffd739b8f9dac10ee91e618053ac39dea9c9ea6
|
data/README.md
CHANGED
@@ -210,6 +210,18 @@ Usage:
|
|
210
210
|
|
211
211
|
`result` will be processed so you do not need to deal with the internals of Kapnismology but just check the properties of a Result object
|
212
212
|
|
213
|
+
## Unit Tests
|
214
|
+
|
215
|
+
Run the Kapnismology unit tests with the command:
|
216
|
+
```
|
217
|
+
bundle exec rspec
|
218
|
+
```
|
219
|
+
|
220
|
+
To verify that Kapnismology also runs properly in non-Rails applications, run the following:
|
221
|
+
```
|
222
|
+
NO_RAILS=1 bundle exec rspec
|
223
|
+
```
|
224
|
+
|
213
225
|
## TODO
|
214
226
|
|
215
227
|
- Automount routes
|
data/lib/kapnismology/engine.rb
CHANGED
@@ -1,31 +1,33 @@
|
|
1
1
|
# Rails support, this may need changes if Rails change internals
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
2
|
+
if defined?(Rails)
|
3
|
+
module Kapnismology
|
4
|
+
begin
|
5
|
+
# Rails engine to automatically load our code and smoke tests libraries
|
6
|
+
class Engine < ::Rails::Engine
|
7
|
+
initializer 'kapnismology.add_autoload_paths', before: :set_autoload_paths do |_app|
|
8
|
+
smoketest_dir = Rails.root.join('lib', 'smoke_test')
|
9
|
+
if smoketest_dir.exist?
|
10
|
+
Dir[File.join(smoketest_dir, '*.rb')].each { |file| require file }
|
11
|
+
end
|
10
12
|
end
|
11
|
-
end
|
12
13
|
|
13
|
-
|
14
|
-
|
14
|
+
isolate_namespace Kapnismology
|
15
|
+
end
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
17
|
+
# Inserts the engine (the smoketest_controller) into a given path.
|
18
|
+
# TODO: how to automatically do this without the user needing to insert?
|
19
|
+
class Routes
|
20
|
+
def self.insert!(path)
|
21
|
+
if defined?(Kapnismology) == false
|
22
|
+
raise 'require kapnismology before trying to insert routes'
|
23
|
+
end
|
24
|
+
Rails.application.routes.draw do
|
25
|
+
mount Kapnismology::Engine, at: path
|
26
|
+
end
|
25
27
|
end
|
26
28
|
end
|
29
|
+
rescue NameError => e
|
30
|
+
puts "Incompatible Rails version #{e}"
|
27
31
|
end
|
28
|
-
rescue NameError => e
|
29
|
-
puts "Incompatible Rails version #{e}"
|
30
32
|
end
|
31
33
|
end
|
data/lib/kapnismology/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kapnismology
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jordi Polo Carres
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -17,7 +17,7 @@ dependencies:
|
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 3.2.13
|
20
|
-
type: :
|
20
|
+
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
@@ -185,4 +185,3 @@ signing_key:
|
|
185
185
|
specification_version: 4
|
186
186
|
summary: Engine for smoke tests.
|
187
187
|
test_files: []
|
188
|
-
has_rdoc:
|