active_mocker 2.2.2 → 2.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +2 -2
- data/lib/active_mocker/mock.rb +1 -0
- data/lib/active_mocker/mock/unrepresentable_const_value.rb +3 -0
- data/lib/active_mocker/mock_creator.rb +17 -2
- data/lib/active_mocker/version.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4daac0cc1807887b124c87e1b99c2dd18c8200f4
|
4
|
+
data.tar.gz: 055f5ad3ecbc226db9a1f922fe17ad860f8a2c6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b384f744eb831ef0523a00e7dc98cf81e79338a1b669b2e97a995a05c67c40e266a7e9315f756cc34708a7939711435fa8877c9f0fa44ea929b4e8da291bbdca
|
7
|
+
data.tar.gz: 35f13e27556125d9df82dd831692a27dc5435f7312b5b716428d1daae17ab7305d44abbcf231971142c27c2439bf1d17f37a4c8aab096096ed4d055917ad9ee3
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,18 @@
|
|
1
1
|
# Changelog
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
+
## 2.2.2 - 2016-06-27
|
5
|
+
### Fix
|
6
|
+
- Constant values assigned to non sudo primitives objects causing issues. https://github.com/zeisler/active_mocker/issues/72
|
7
|
+
|
8
|
+
## Enhancement
|
9
|
+
- Tested support for Rails RC2
|
10
|
+
|
11
|
+
## 2.2.2 - 2016-05-05
|
12
|
+
### Fix
|
13
|
+
- When using "active_mocker/rspec_helper" with active_mocker:true tag, subclassed mocks were not getting auto stubbed.
|
14
|
+
- colorize gem was not being required.
|
15
|
+
|
4
16
|
## 2.2.1 - 2016-05-03
|
5
17
|
### Fix
|
6
18
|
- Remove hack for String#colorize that would cause the error: "NoMethodError: super: no superclass method `colorize' for #<String>"
|
data/README.md
CHANGED
data/lib/active_mocker/mock.rb
CHANGED
@@ -26,4 +26,5 @@ require "active_mocker/mock/do_nothing_active_record_methods"
|
|
26
26
|
require "active_mocker/mock/records"
|
27
27
|
require "active_mocker/mock/object_inspect"
|
28
28
|
require "active_mocker/mock/alias_attribute"
|
29
|
+
require "active_mocker/mock/unrepresentable_const_value"
|
29
30
|
require "active_mocker/mock/base"
|
@@ -145,10 +145,25 @@ module ActiveMocker
|
|
145
145
|
end
|
146
146
|
|
147
147
|
module ModulesConstants
|
148
|
+
require "active_mocker/mock/unrepresentable_const_value"
|
149
|
+
|
150
|
+
class Inspectable
|
151
|
+
attr_reader :inspect
|
152
|
+
|
153
|
+
def initialize(inspect)
|
154
|
+
@inspect = inspect
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
148
158
|
def constants
|
149
159
|
class_introspector.get_class.constants.each_with_object({}) do |v, const|
|
150
|
-
c
|
151
|
-
|
160
|
+
c = class_introspector.get_class.const_get(v)
|
161
|
+
next if [Module, Class].include?(c.class)
|
162
|
+
if /\A#</ =~ c.inspect
|
163
|
+
const[v] = Inspectable.new("ActiveMocker::UNREPRESENTABLE_CONST_VALUE")
|
164
|
+
else
|
165
|
+
const[v] = c
|
166
|
+
end
|
152
167
|
end
|
153
168
|
end
|
154
169
|
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_mocker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.3
|
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-
|
11
|
+
date: 2016-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '4.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '4.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -213,6 +213,7 @@ files:
|
|
213
213
|
- lib/active_mocker/mock/relation.rb
|
214
214
|
- lib/active_mocker/mock/single_relation.rb
|
215
215
|
- lib/active_mocker/mock/template_methods.rb
|
216
|
+
- lib/active_mocker/mock/unrepresentable_const_value.rb
|
216
217
|
- lib/active_mocker/mock_creator.rb
|
217
218
|
- lib/active_mocker/mock_template.erb
|
218
219
|
- lib/active_mocker/mock_template/_associations.erb
|
@@ -252,7 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
252
253
|
version: '0'
|
253
254
|
requirements: []
|
254
255
|
rubyforge_project:
|
255
|
-
rubygems_version: 2.
|
256
|
+
rubygems_version: 2.5.1
|
256
257
|
signing_key:
|
257
258
|
specification_version: 4
|
258
259
|
summary: Creates mocks from Active Record models. Allows your test suite to run very
|