kapnismology 2.1.0 → 2.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4fb05baaf32255a8696ec983d04eca2bef595783
4
- data.tar.gz: 97121d40d30b1b23aba809308ea362dc4b3596ba
3
+ metadata.gz: 4339000a844a6c3f722b1980f8e70a5acc78f5e5
4
+ data.tar.gz: fb8b3a15c6d841d73b5f9d1198188e8e4e1aa572
5
5
  SHA512:
6
- metadata.gz: ed406d08a7fe4cef98a03a4e5688a74881e923fcc39b4e8927c51d3e15fa12beaff52b4ee971aba3044bb2ce5ab27633c73e3068dc0450d8f8094f6c24344fef
7
- data.tar.gz: ef19bb1558bf9c336571584a0a3ab06733e92aac779b22ea689e4d37946a851dc98f3ff2bf2117ecc86328b27f5720bc77fae83fb3cb6bd8f780b0e700f37185
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
@@ -1,31 +1,33 @@
1
1
  # Rails support, this may need changes if Rails change internals
2
- module Kapnismology
3
- begin
4
- # Rails engine to automatically load our code and smoke tests libraries
5
- class Engine < ::Rails::Engine
6
- initializer 'kapnismology.add_autoload_paths', before: :set_autoload_paths do |_app|
7
- smoketest_dir = Rails.root.join('lib', 'smoke_test')
8
- if smoketest_dir.exist?
9
- Dir[File.join(smoketest_dir, '*.rb')].each { |file| require file }
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
- isolate_namespace Kapnismology
14
- end
14
+ isolate_namespace Kapnismology
15
+ end
15
16
 
16
- # Inserts the engine (the smoketest_controller) into a given path.
17
- # TODO: how to automatically do this without the user needing to insert?
18
- class Routes
19
- def self.insert!(path)
20
- if defined?(Kapnismology) == false
21
- raise 'require kapnismology before trying to insert routes'
22
- end
23
- Rails.application.routes.draw do
24
- mount Kapnismology::Engine, at: path
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
@@ -20,7 +20,7 @@ module Kapnismology
20
20
  end
21
21
 
22
22
  def to_json
23
- evaluations.to_json
23
+ evaluations.map { |evaluation| evaluation.as_json }.to_json
24
24
  end
25
25
 
26
26
  private
@@ -1,3 +1,3 @@
1
1
  module Kapnismology
2
- VERSION = '2.1.0'.freeze
2
+ VERSION = '2.2.0'.freeze
3
3
  end
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.1.0
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-08-24 00:00:00.000000000 Z
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: :runtime
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: