active_mocker 2.3.2 → 2.3.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 +8 -0
- data/README.md +0 -1
- data/lib/active_mocker/mock/base.rb +7 -1
- data/lib/active_mocker/mock/relation.rb +5 -1
- data/lib/active_mocker/rspec_helper.rb +1 -0
- data/lib/active_mocker/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a89dd0dfab6db30ab5b31de58cfcb6bf5b0873f
|
4
|
+
data.tar.gz: 44a82456fc418273be4e242b3d46e0bf71a5ccec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 447e2c97fdfcb91de7c2a0e7e09329164e2319c94d7c52abf5fec58e939dad1ae3b0e08c1f65c9ee81a54a05cfb838b5537e55e5ea990e1597d7721885ba2e63
|
7
|
+
data.tar.gz: 4717823b1650b77109f63befac13ff0ff0e6a4111cdfc5d22cd318e27fb873fddc9a1762ccfce11b0fd493bf05669b8e24509ac63af675b23a3cc0f300c28f26
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
## 2.3.3 - 2016-10-13
|
5
|
+
### Enhancement
|
6
|
+
- Auto stubbing of ActiveRecord::RecordNotFound with requiring "active_mocker/rspec_helper"
|
7
|
+
|
8
|
+
### Fix
|
9
|
+
- NoMethodError when calling #find_by! on an association when the record could not be found.
|
10
|
+
|
3
11
|
## 2.3.2 - 2016-09-26
|
4
12
|
### Fix
|
5
13
|
- Fix case where parent class was not being set and set was set to `ActiveMocker::Base`.
|
data/README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# ActiveMocker
|
2
2
|
[![Gem Version](https://badge.fury.io/rb/active_mocker.svg)](http://badge.fury.io/rb/active_mocker)
|
3
3
|
[![Build Status](https://travis-ci.org/zeisler/active_mocker.png?branch=master)](https://travis-ci.org/zeisler/active_mocker)
|
4
|
-
[![Code Climate](https://codeclimate.com/github/zeisler/active_mocker.png)](https://codeclimate.com/github/zeisler/active_mocker)
|
5
4
|
[![Dependency Status](https://gemnasium.com/zeisler/active_mocker.svg)](https://gemnasium.com/zeisler/active_mocker)
|
6
5
|
[![Gitter chat](https://badges.gitter.im/zeisler/active_mocker.png)](https://gitter.im/zeisler/active_mocker)
|
7
6
|
[![Gittip](http://img.shields.io/gittip/zeisler.svg)](https://www.gittip.com/zeisler/)
|
@@ -301,7 +301,7 @@ module ActiveMocker
|
|
301
301
|
end
|
302
302
|
|
303
303
|
def inspect
|
304
|
-
ObjectInspect.new(
|
304
|
+
ObjectInspect.new(name, attributes).to_s
|
305
305
|
end
|
306
306
|
|
307
307
|
# Will not allow attributes to be changed
|
@@ -313,6 +313,12 @@ module ActiveMocker
|
|
313
313
|
@attributes.freeze; self
|
314
314
|
end
|
315
315
|
|
316
|
+
def name
|
317
|
+
self.class.name
|
318
|
+
end
|
319
|
+
|
320
|
+
private :name
|
321
|
+
|
316
322
|
module PropertiesGetterAndSetter
|
317
323
|
# Returns the value of the attribute identified by <tt>attr_name</tt> after
|
318
324
|
# it has been typecast (for example, "2004-12-12" in a date column is cast
|
@@ -11,7 +11,7 @@ module ActiveMocker
|
|
11
11
|
def inspect
|
12
12
|
entries = to_a.take(11).map!(&:inspect)
|
13
13
|
entries[10] = "..." if entries.size == 11
|
14
|
-
"#<#{
|
14
|
+
"#<#{name} [#{entries.join(", ")}]>"
|
15
15
|
end
|
16
16
|
|
17
17
|
def from_limit?
|
@@ -23,5 +23,9 @@ module ActiveMocker
|
|
23
23
|
def set_from_limit
|
24
24
|
@from_limit = true
|
25
25
|
end
|
26
|
+
|
27
|
+
def name
|
28
|
+
self.class.name
|
29
|
+
end
|
26
30
|
end
|
27
31
|
end
|
@@ -9,6 +9,7 @@ RSpec.configure do |config|
|
|
9
9
|
unless ENV["RUN_WITH_RAILS"] && self.class.metadata[:rails_compatible]
|
10
10
|
active_mocker.mocks.each { |class_name, mock| stub_const(class_name, mock) }
|
11
11
|
end
|
12
|
+
stub_const("ActiveRecord::RecordNotFound", ActiveMocker::RecordNotFound)
|
12
13
|
end
|
13
14
|
|
14
15
|
config.after(:all, active_mocker: true) do
|
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.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-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|