model_mocker 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/model_mocker.rb +5 -1
- metadata +17 -3
data/lib/model_mocker.rb
CHANGED
@@ -25,6 +25,10 @@ class ModelMocker
|
|
25
25
|
def new_record?
|
26
26
|
id.nil?
|
27
27
|
end
|
28
|
+
|
29
|
+
def persisted?
|
30
|
+
!new_record?
|
31
|
+
end
|
28
32
|
end
|
29
33
|
|
30
34
|
module ActiveRecordHook
|
@@ -58,7 +62,7 @@ class ModelMocker
|
|
58
62
|
@instance
|
59
63
|
end
|
60
64
|
|
61
|
-
# The model instance will report that it's a new record
|
65
|
+
# The model instance will always report that it's a new record
|
62
66
|
def as_new_record
|
63
67
|
instance.stubs(:new_record?).returns(true)
|
64
68
|
end
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: model_mocker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 21
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 1
|
7
8
|
- 1
|
8
|
-
-
|
9
|
-
version: 1.1.
|
9
|
+
- 3
|
10
|
+
version: 1.1.3
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Matt Patterson
|
@@ -21,9 +22,11 @@ dependencies:
|
|
21
22
|
name: rspec
|
22
23
|
prerelease: false
|
23
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
24
26
|
requirements:
|
25
27
|
- - ">="
|
26
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 13
|
27
30
|
segments:
|
28
31
|
- 1
|
29
32
|
- 2
|
@@ -35,9 +38,11 @@ dependencies:
|
|
35
38
|
name: activerecord
|
36
39
|
prerelease: false
|
37
40
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
38
42
|
requirements:
|
39
43
|
- - ">="
|
40
44
|
- !ruby/object:Gem::Version
|
45
|
+
hash: 5
|
41
46
|
segments:
|
42
47
|
- 2
|
43
48
|
- 3
|
@@ -48,9 +53,11 @@ dependencies:
|
|
48
53
|
name: mocha
|
49
54
|
prerelease: false
|
50
55
|
requirement: &id003 !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
51
57
|
requirements:
|
52
58
|
- - ">="
|
53
59
|
- !ruby/object:Gem::Version
|
60
|
+
hash: 43
|
54
61
|
segments:
|
55
62
|
- 0
|
56
63
|
- 9
|
@@ -74,6 +81,9 @@ files:
|
|
74
81
|
- lib/model_mocker/railtie.rb
|
75
82
|
- lib/model_mocker.rb
|
76
83
|
- rails/init.rb
|
84
|
+
- spec/spec.opts
|
85
|
+
- spec/model_mocker_spec.rb
|
86
|
+
- spec/spec_helper.rb
|
77
87
|
has_rdoc: true
|
78
88
|
homepage: http://github.com/fidothe/model_mocker
|
79
89
|
licenses: []
|
@@ -84,23 +94,27 @@ rdoc_options:
|
|
84
94
|
require_paths:
|
85
95
|
- lib
|
86
96
|
required_ruby_version: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
87
98
|
requirements:
|
88
99
|
- - ">="
|
89
100
|
- !ruby/object:Gem::Version
|
101
|
+
hash: 3
|
90
102
|
segments:
|
91
103
|
- 0
|
92
104
|
version: "0"
|
93
105
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
94
107
|
requirements:
|
95
108
|
- - ">="
|
96
109
|
- !ruby/object:Gem::Version
|
110
|
+
hash: 3
|
97
111
|
segments:
|
98
112
|
- 0
|
99
113
|
version: "0"
|
100
114
|
requirements: []
|
101
115
|
|
102
116
|
rubyforge_project:
|
103
|
-
rubygems_version: 1.3.
|
117
|
+
rubygems_version: 1.3.7
|
104
118
|
signing_key:
|
105
119
|
specification_version: 3
|
106
120
|
summary: Declarative partial mocking for ActiveRecord
|