ardb 0.11.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ardb/record_spy.rb +4 -0
- data/lib/ardb/version.rb +1 -1
- data/test/unit/record_spy_tests.rb +21 -7
- metadata +4 -4
data/lib/ardb/record_spy.rb
CHANGED
data/lib/ardb/version.rb
CHANGED
@@ -3,12 +3,7 @@ require 'ardb/record_spy'
|
|
3
3
|
|
4
4
|
module Ardb::RecordSpy
|
5
5
|
|
6
|
-
class
|
7
|
-
include Ardb::RecordSpy
|
8
|
-
attr_accessor :name
|
9
|
-
end
|
10
|
-
|
11
|
-
class BaseTests < Assert::Context
|
6
|
+
class UnitTests < Assert::Context
|
12
7
|
desc "Ardb::RecordSpy"
|
13
8
|
setup do
|
14
9
|
@instance = MyRecord.new
|
@@ -130,7 +125,7 @@ module Ardb::RecordSpy
|
|
130
125
|
|
131
126
|
end
|
132
127
|
|
133
|
-
class GeneratorTests <
|
128
|
+
class GeneratorTests < UnitTests
|
134
129
|
desc "to generate record spy classes"
|
135
130
|
setup do
|
136
131
|
@record_spy_class = Ardb::RecordSpy.new do
|
@@ -149,4 +144,23 @@ module Ardb::RecordSpy
|
|
149
144
|
|
150
145
|
end
|
151
146
|
|
147
|
+
class InstanceTests < UnitTests
|
148
|
+
subject{ @instance }
|
149
|
+
|
150
|
+
should have_imeths :update_column
|
151
|
+
|
152
|
+
should "allow spying the update_column method by just writing the value" do
|
153
|
+
assert_not_equal 'updated', subject.name
|
154
|
+
|
155
|
+
subject.update_column(:name, 'updated')
|
156
|
+
assert_equal 'updated', subject.name
|
157
|
+
end
|
158
|
+
|
159
|
+
end
|
160
|
+
|
161
|
+
class MyRecord
|
162
|
+
include Ardb::RecordSpy
|
163
|
+
attr_accessor :name
|
164
|
+
end
|
165
|
+
|
152
166
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ardb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 47
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 12
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.12.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kelly Redding
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2013-09-
|
19
|
+
date: 2013-09-26 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: assert
|