active_mocker 2.2.3 → 2.2.4
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 +5 -1
- data/lib/active_mocker/inspectable.rb +8 -0
- data/lib/active_mocker/inspectable/bigdecimal.rb +10 -0
- data/lib/active_mocker/inspectable/date.rb +16 -0
- data/lib/active_mocker/inspectable/dir.rb +10 -0
- data/lib/active_mocker/inspectable/file.rb +10 -0
- data/lib/active_mocker/inspectable/pathname.rb +10 -0
- data/lib/active_mocker/inspectable/struct.rb +10 -0
- data/lib/active_mocker/inspectable/time.rb +10 -0
- data/lib/active_mocker/mock_creator.rb +5 -0
- data/lib/active_mocker/mock_template/_class_methods.erb +2 -2
- data/lib/active_mocker/version.rb +1 -1
- metadata +11 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9be1a4a8a33f8e58e8733ed44ebec8d7a96a41aa
|
4
|
+
data.tar.gz: 911a0d874d5679fc5e5e85271228ed50844009c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2043c2a02be22bff409c691d395255bb73cbcd218fa7f1ceab4b609f55b179734394a0f4a0aa7803b3b61674bad0ab062804ce68c19e187bb7a609f41c7bd77d
|
7
|
+
data.tar.gz: dab8ebc81628445fafaea0693c9eb5d7791a5336a6b720be72fc3b842b8b1a261fc9060e0b9528df49dc78650e55819bb12bc31057b2ad3092a24a40d718a57b
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
-
## 2.2.
|
4
|
+
## 2.2.4 - 2016-06-27
|
5
|
+
### Fix
|
6
|
+
- `BigDecimal`, `Date`, `DateTime`, and `Time` when used as defaults in the schema caused mock generation failures.
|
7
|
+
|
8
|
+
## 2.2.3 - 2016-06-27
|
5
9
|
### Fix
|
6
10
|
- Constant values assigned to non sudo primitives objects causing issues. https://github.com/zeisler/active_mocker/issues/72
|
7
11
|
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require "active_mocker/inspectable/bigdecimal"
|
3
|
+
require "active_mocker/inspectable/date"
|
4
|
+
require "active_mocker/inspectable/dir"
|
5
|
+
require "active_mocker/inspectable/file"
|
6
|
+
require "active_mocker/inspectable/pathname"
|
7
|
+
require "active_mocker/inspectable/struct"
|
8
|
+
require "active_mocker/inspectable/time"
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module ActiveMocker
|
3
|
+
module Inspectable
|
4
|
+
refine Date do
|
5
|
+
def inspect
|
6
|
+
"Date.new(%s, %s, %s)" % [year, month, day]
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
refine DateTime do
|
11
|
+
def inspect
|
12
|
+
strftime("DateTime.new(%Y, %-m, %-d, %-H, %-M, %-S, \"%:z\")")
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#_class_methods.erb
|
2
2
|
class << self
|
3
3
|
def attributes
|
4
|
-
@attributes ||= HashWithIndifferentAccess.new(<%= attributes_with_defaults %>).merge(super)
|
4
|
+
@attributes ||= HashWithIndifferentAccess.new(<%= attributes_with_defaults.map {|key,value| %Q[#{key}: #{value.inspect}]}.join(", ") %>).merge(super)
|
5
5
|
end
|
6
6
|
|
7
7
|
def types
|
@@ -23,7 +23,7 @@
|
|
23
23
|
private :mocked_class
|
24
24
|
|
25
25
|
def attribute_names
|
26
|
-
@attribute_names ||=
|
26
|
+
@attribute_names ||= attributes.stringify_keys.keys
|
27
27
|
end
|
28
28
|
|
29
29
|
def primary_key
|
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.2.
|
4
|
+
version: 2.2.4
|
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-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -193,6 +193,14 @@ files:
|
|
193
193
|
- lib/active_mocker/file_writer.rb
|
194
194
|
- lib/active_mocker/generate.rb
|
195
195
|
- lib/active_mocker/hash_new_style.rb
|
196
|
+
- lib/active_mocker/inspectable.rb
|
197
|
+
- lib/active_mocker/inspectable/bigdecimal.rb
|
198
|
+
- lib/active_mocker/inspectable/date.rb
|
199
|
+
- lib/active_mocker/inspectable/dir.rb
|
200
|
+
- lib/active_mocker/inspectable/file.rb
|
201
|
+
- lib/active_mocker/inspectable/pathname.rb
|
202
|
+
- lib/active_mocker/inspectable/struct.rb
|
203
|
+
- lib/active_mocker/inspectable/time.rb
|
196
204
|
- lib/active_mocker/loaded_mocks.rb
|
197
205
|
- lib/active_mocker/mock.rb
|
198
206
|
- lib/active_mocker/mock/alias_attribute.rb
|
@@ -259,3 +267,4 @@ specification_version: 4
|
|
259
267
|
summary: Creates mocks from Active Record models. Allows your test suite to run very
|
260
268
|
fast by not loading Rails or a database.
|
261
269
|
test_files: []
|
270
|
+
has_rdoc:
|