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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b786f26685352ec1315bf5b715c7b2ffdcd37df6
4
- data.tar.gz: f70eee54d0a03d5f4fe13a1a5aa077dd11de19da
3
+ metadata.gz: 360148204937143cf5ce056298180ce73dd1f1bc
4
+ data.tar.gz: 3fff60556e04613657e514db3b6de1a93966e839
5
5
  SHA512:
6
- metadata.gz: b1566d93d8b03eb55856f62e03275da366218a40929d04be9c95140ea7791c6f71fe2bc83fd8bfbed2bfdbf6e19d34f96898c5e9be7567d965c3739b7265ef9f
7
- data.tar.gz: ca35c36eed333a2f64777241a968bfd19c937b6914154ee8d6743f1640c40344992afdcaa2dbea67bb26a165ceee976b41400a679773fcfc96288ad6a925949d
6
+ metadata.gz: 89d5655976e387096bdb70bce13cb4a7dfc179242a7970894e13249c5eb52c05f71bd3467481254437d1b1a91b2dcd4b8f9a8d84847b31d3b0cfa2de4f3a7515
7
+ data.tar.gz: c110bf9e752433bd4cd9d9bcf740969da68e3aa2658dbe67e47e2fcf9c2a53312cee79203feae2eb8eb7b7da272ba5b0e8dd23de61af388881d8e43ea16826fe
@@ -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 klasses_to_be_mocked.include?(parent_class_name)
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
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ActiveMocker
3
- VERSION = "2.3.1"
3
+ VERSION = "2.3.2"
4
4
  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.1
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-26 00:00:00.000000000 Z
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.4.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.4.0
110
+ version: 0.6.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: dissociated_introspection
113
113
  requirement: !ruby/object:Gem::Requirement