appfuel 0.6.11 → 0.6.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6313525d5aa0c8a256849987ec551fe5bad2cea6
4
- data.tar.gz: 6ff272ee94db70eda29251afab7b6cdecaf955de
3
+ metadata.gz: 7245f8bd0dcc448776f5fba5109c71459955ff72
4
+ data.tar.gz: befaad13d4af699fdb9a6672488891c933d8e67b
5
5
  SHA512:
6
- metadata.gz: 5ba5a696fe51d6742240d8f4ef33a7d597eb2341d42b161c221980efb2d2c9b19801b25dd74ddb5e56e4fbd7e313ac98c0db1550ac2b6a003991544f251023dc
7
- data.tar.gz: 66d023e514c20494dac26f4e37d68836ec62bd547017f6deb5ae945cd56117707307efe469b20a0f8b4b1367ac16a220a663292bd1bd74ab3389f6fbcbd069d1
6
+ metadata.gz: d2ada4f3003f90c531fe8f8248e1997a202ac7124a63de37b2100b351d4383cc741e222a1505391541439bd1a0308487d7f9e7a5507c8c4c34d8a96906ec6b5a
7
+ data.tar.gz: 29e3e7def9de93a4b27afbdab27c1ee4cc8d42e163929e7cd7a10c5f53e0bd79074c56483441bc6518dda7325bc69f90b9e0d821aef16d8081ea7f6d11bd1a45
data/CHANGELOG.md CHANGED
@@ -5,9 +5,10 @@ All notable changes to this project will be documented in this file. (Pending ap
5
5
 
6
6
 
7
7
  # Releases
8
- ## [[0.6.11]](https://github.com/rsb/appfuel/releases/tag/0.6.11) 2017-09-26
9
- ### Removed
10
- - removed dependency on pg gem
8
+ ## [[0.6.12]](https://github.com/rsb/appfuel/releases/tag/0.6.12) 2017-09-27
9
+ ### Added
10
+ - appfuel/testing_spec/appfuel_spec_helper adding rspec helpers for other
11
+ libraries to use.
11
12
 
12
13
  ## [[0.6.10]](https://github.com/rsb/appfuel/releases/tag/0.6.10) 2017-09-21
13
14
  ### Added
@@ -0,0 +1,18 @@
1
+ require 'appfuel'
2
+ require_relative 'helpers'
3
+
4
+
5
+ RSpec.configure do |config|
6
+ config.before(:each) do
7
+
8
+ @types = Types.container
9
+ Types.send(:instance_variable_set, :@container, @types.dup)
10
+ Appfuel.framework_container = Dry::Container.new
11
+ end
12
+
13
+ config.after(:each) do
14
+ Types.send(:instance_variable_set, :@container, @types)
15
+ end
16
+
17
+ config.include Appfuel::TestingSpec::Helpers
18
+ end
@@ -0,0 +1,57 @@
1
+ module Appfuel
2
+ module TestingSpec
3
+ module Helpers
4
+ def allow_const_defined_as_true(mod, name)
5
+ allow_const_defined(mod, name, true)
6
+ end
7
+
8
+ def allow_const_defined_as_false(mod, name)
9
+ allow_const_defined(mod, name, false)
10
+ end
11
+
12
+ def allow_const_defined(mod, name, result)
13
+ allow(mod).to receive(:const_defined?).with(name) { result }
14
+ end
15
+
16
+ def allow_const_get(mod, name, result)
17
+ allow(mod).to receive(:const_get).with(name) { result }
18
+ end
19
+
20
+ def build_container(data = {})
21
+ container = Dry::Container.new
22
+ data.each {|key, value| container.register(key, value)}
23
+ container
24
+ end
25
+
26
+ def allow_type(name, type)
27
+ allow(Types).to receive(:key?).with(name) { true }
28
+ allow(Types).to receive(:[]).with(name) { type }
29
+ type
30
+ end
31
+
32
+ def allow_domain_type(name, type)
33
+ basename = name.to_s.split('.').last
34
+ allow_type(name, type)
35
+ allow(type).to receive(:domain_name).with(no_args) { name }
36
+ allow(type).to receive(:domain_basename).with(no_args) { basename }
37
+ type
38
+ end
39
+
40
+ def allow_db_type(name, type)
41
+ allow(Types::Db).to receive(:key?).with(name) { true }
42
+ allow(Types::Db).to receive(:[]).with(name) { type }
43
+ end
44
+
45
+ def allow_db_column_names(db_class, cols)
46
+ allow(db_class).to receive(:column_names).with(no_args) { cols }
47
+ end
48
+
49
+ def allow_db_entity_attributes(db_class, hash)
50
+ allow(db_class).to receive(:entity_attributes).with(no_args) { hash }
51
+ end
52
+
53
+ def mock_db_class(name, cols = [])
54
+ end
55
+ end
56
+ end
57
+ end
@@ -1,3 +1,3 @@
1
1
  module Appfuel
2
- VERSION = "0.6.11"
2
+ VERSION = "0.6.12"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appfuel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.11
4
+ version: 0.6.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Scott-Buccleuch
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-26 00:00:00.000000000 Z
11
+ date: 2017-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -357,6 +357,8 @@ files:
357
357
  - lib/appfuel/storage/web_api.rb
358
358
  - lib/appfuel/storage/web_api/http_model.rb
359
359
  - lib/appfuel/storage/web_api/repository.rb
360
+ - lib/appfuel/testing_spec/appfuel_spec_helper.rb
361
+ - lib/appfuel/testing_spec/helpers.rb
360
362
  - lib/appfuel/types.rb
361
363
  - lib/appfuel/validation.rb
362
364
  - lib/appfuel/validation/validator.rb