verified_double 0.6 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e6bfd029b36750aeb01fc1a6d0176f58a7d3c623
4
- data.tar.gz: aace4f64cbafacac1d051939faa93a6c7c1a1742
3
+ metadata.gz: d5aa54bfcb029e5501e4ec6598a02c1a77ec28da
4
+ data.tar.gz: 590332886ad996a7589834ad01c4fef2f4f8dc3f
5
5
  SHA512:
6
- metadata.gz: 90eda38fbddf5d17f03df6f06bbc23e099598564e9329fb6e891d9dfb3516de474352e46f5e4840cf3252ca03082554e6324c38556ad272fb464d745a95315b4
7
- data.tar.gz: 9fbae516d65fbafc7f748479c147eb8fb35f62f1a0d450940f397142d007038fc6fc000a6e920c22e70b344a87c99144eea4a4913c56b00d84e219877de992fc
6
+ metadata.gz: b4804ffcdef59cfba843d866002ee5635b6c0f0611faaeb3c3b7d75a5f3a7fbca80a5240c8d81cc423237be809f6f49d80a3fb508c55ddb2b42a88d0fefce42f
7
+ data.tar.gz: f4abb8144c06a71798f792ea403d3959c5ae1f82fd8dee1bbd14e6b1e35aa31a146349c877b85ffb7a3d0afcea884272032307c5b2b3ec8e327b9eda40bfd7d1
data/CHANGELOG.markdown CHANGED
@@ -1,3 +1,8 @@
1
+ 0.6.1 - 2013-12-30
2
+ ------------------
3
+
4
+ * Fix RspecDoubleValue#content_class: Method fails if the value is an double of an inheriting class.
5
+
1
6
  0.6.0 - 2013-12-28
2
7
  ------------------
3
8
 
@@ -1,3 +1,8 @@
1
+ 0.6.1 - 2013-12-30
2
+ ------------------
3
+
4
+ * Fix RspecDoubleValue#content_class: Method fails if the value is an double of an inheriting class.
5
+
1
6
  0.6.0 - 2013-12-28
2
7
  ------------------
3
8
 
@@ -6,7 +6,8 @@ module VerifiedDouble
6
6
  end
7
7
 
8
8
  def content_class
9
- content.instance_variable_get('@name').constantize
9
+ result = content.instance_variable_get('@name')
10
+ result.is_a?(Class) ? result : result.constantize
10
11
  end
11
12
  end
12
13
  end
@@ -1,3 +1,3 @@
1
1
  module VerifiedDouble
2
- VERSION = "0.6"
2
+ VERSION = "0.6.1"
3
3
  end
@@ -4,7 +4,10 @@ describe VerifiedDouble::MethodSignature::RspecDoubleValue do
4
4
  class Item
5
5
  end
6
6
 
7
- let(:class_name){ 'Item' }
7
+ class SuperItem < Item
8
+ end
9
+
10
+ let(:class_name) { 'Item' }
8
11
 
9
12
  let(:rspec_double) { double(class_name) }
10
13
  subject { described_class.new(rspec_double) }
@@ -15,6 +18,15 @@ describe VerifiedDouble::MethodSignature::RspecDoubleValue do
15
18
  expect(subject.content_class).to eq(Item)
16
19
  end
17
20
  end
21
+
22
+ context 'where the value is an instance double of an inheriting class' do
23
+ let(:rspec_double) { double(SuperItem) }
24
+ subject { described_class.new(rspec_double) }
25
+
26
+ it "is the class represented by the class_name of the recording double" do
27
+ expect(subject.content_class).to eq(SuperItem)
28
+ end
29
+ end
18
30
  end
19
31
 
20
32
  describe "#content_as_instance" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: verified_double
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.6'
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - George Mendoza
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-28 00:00:00.000000000 Z
11
+ date: 2013-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -194,7 +194,7 @@ files:
194
194
  - spec/verified_double/method_signature/boolean_value_spec.rb
195
195
  - spec/verified_double/method_signature/class_value_spec.rb
196
196
  - spec/verified_double/method_signature/instance_value_spec.rb
197
- - spec/verified_double/method_signature/rspec_double_spec.rb
197
+ - spec/verified_double/method_signature/rspec_double_value_spec.rb
198
198
  - spec/verified_double/method_signature/value_spec.rb
199
199
  - spec/verified_double/method_signature_spec.rb
200
200
  - spec/verified_double/method_signatures_report_spec.rb
@@ -251,7 +251,7 @@ test_files:
251
251
  - spec/verified_double/method_signature/boolean_value_spec.rb
252
252
  - spec/verified_double/method_signature/class_value_spec.rb
253
253
  - spec/verified_double/method_signature/instance_value_spec.rb
254
- - spec/verified_double/method_signature/rspec_double_spec.rb
254
+ - spec/verified_double/method_signature/rspec_double_value_spec.rb
255
255
  - spec/verified_double/method_signature/value_spec.rb
256
256
  - spec/verified_double/method_signature_spec.rb
257
257
  - spec/verified_double/method_signatures_report_spec.rb