active_mocker 2.3.1 → 2.3.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/CHANGELOG.md +4 -0
- data/lib/active_mocker/parent_class.rb +11 -1
- data/lib/active_mocker/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 360148204937143cf5ce056298180ce73dd1f1bc
|
4
|
+
data.tar.gz: 3fff60556e04613657e514db3b6de1a93966e839
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89d5655976e387096bdb70bce13cb4a7dfc179242a7970894e13249c5eb52c05f71bd3467481254437d1b1a91b2dcd4b8f9a8d84847b31d3b0cfa2de4f3a7515
|
7
|
+
data.tar.gz: c110bf9e752433bd4cd9d9bcf740969da68e3aa2658dbe67e47e2fcf9c2a53312cee79203feae2eb8eb7b7da272ba5b0e8dd23de61af388881d8e43ea16826fe
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Changelog
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
|
+
## 2.3.2 - 2016-09-26
|
4
|
+
### Fix
|
5
|
+
- Fix case where parent class was not being set and set was set to `ActiveMocker::Base`.
|
6
|
+
- Stop generating Mocks when table cannot be found.
|
3
7
|
|
4
8
|
## 2.3.1 - 2016-09-26
|
5
9
|
### Fix
|
@@ -36,7 +36,7 @@ module ActiveMocker
|
|
36
36
|
|
37
37
|
def deal_with_parent
|
38
38
|
if parent_class <= active_record_base_klass
|
39
|
-
@parent_mock_name = parent_class_name if
|
39
|
+
@parent_mock_name = parent_class_name if included_mocked_class?
|
40
40
|
else
|
41
41
|
create_error("#{class_name} does not inherit from ActiveRecord::Base")
|
42
42
|
end
|
@@ -62,5 +62,15 @@ module ActiveMocker
|
|
62
62
|
def parent_class
|
63
63
|
parent_class_name.constantize
|
64
64
|
end
|
65
|
+
|
66
|
+
def included_mocked_class?
|
67
|
+
sanitize_consts(klasses_to_be_mocked).include?(sanitize_consts(parent_class_name).first)
|
68
|
+
end
|
69
|
+
|
70
|
+
def sanitize_consts(consts)
|
71
|
+
[*consts].map do |const|
|
72
|
+
const.split("::").reject(&:empty?).join("::")
|
73
|
+
end
|
74
|
+
end
|
65
75
|
end
|
66
76
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_mocker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dustin Zeisler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.
|
103
|
+
version: 0.6.0
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.
|
110
|
+
version: 0.6.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: dissociated_introspection
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|