verified_double 0.8.0 → 0.8.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 227d5bbfad5bc889bac73cee492aecdf58590306
|
4
|
+
data.tar.gz: 575d210a0ddbc0b3c773b8f0ca81a8c7553ef3fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddadca8f1ffcd2f62ddb53b184b8b620b930b9050e76687bc0d61dbb9b267a9c1d0506cffff2f96de3cee548144e7d497d22c5c56f70f638b5f9c7610ab0ae3e
|
7
|
+
data.tar.gz: 365a908a9b52f06de299cf9819282e1b524b94c146d8104f5a8d1ab796e81f8ec6de3646338163ac7a1a1cee5f27245c95333d8d64911b66e48f438e1794fa11
|
data/CHANGELOG.markdown
CHANGED
data/features/CHANGELOG.markdown
CHANGED
@@ -3,10 +3,13 @@ module VerifiedDouble
|
|
3
3
|
def described_class
|
4
4
|
if description.is_a?(Module)
|
5
5
|
description
|
6
|
-
elsif
|
6
|
+
elsif !metadata[:example_group].nil?
|
7
7
|
ExampleMetadata.new(metadata[:example_group]).described_class
|
8
8
|
else
|
9
|
-
raise
|
9
|
+
raise StandardError,
|
10
|
+
"The VerifiedDouble contract spec described class '#{description}' is
|
11
|
+
invalid. The described class must be a class or a module."
|
12
|
+
.gsub(/\s+/, ' ')
|
10
13
|
end
|
11
14
|
end
|
12
15
|
|
@@ -17,8 +20,11 @@ module VerifiedDouble
|
|
17
20
|
def method_signature_string
|
18
21
|
if description =~ /^[\.\#]/
|
19
22
|
description
|
20
|
-
elsif
|
21
|
-
raise
|
23
|
+
elsif metadata[:example_group].nil?
|
24
|
+
raise StandardError,
|
25
|
+
"The VerifiedDouble contract spec method '#{description}' is invalid.
|
26
|
+
The method must start with # or ."
|
27
|
+
.gsub(/\s+/, ' ')
|
22
28
|
else
|
23
29
|
ExampleMetadata.new(metadata[:example_group]).method_signature_string
|
24
30
|
end
|
@@ -34,16 +34,15 @@ describe VerifiedDouble::ExampleMetadata do
|
|
34
34
|
end
|
35
35
|
|
36
36
|
context "where the described class is a string" do
|
37
|
-
let(:
|
38
|
-
{
|
39
|
-
example_group: {
|
40
|
-
description_args: [klass.to_s]
|
41
|
-
}
|
42
|
-
}
|
43
|
-
end
|
37
|
+
let(:klass) { Object.to_s }
|
44
38
|
|
45
39
|
it "should raise an error" do
|
46
|
-
expect(-> { subject.described_class }).to raise_error
|
40
|
+
expect(-> { subject.described_class }).to raise_error(
|
41
|
+
StandardError, "The VerifiedDouble contract spec described class
|
42
|
+
'Object' is invalid.
|
43
|
+
The described class must be a class or a module."
|
44
|
+
.gsub(/\s+/, ' ')
|
45
|
+
)
|
47
46
|
end
|
48
47
|
end
|
49
48
|
end
|
@@ -54,16 +53,14 @@ describe VerifiedDouble::ExampleMetadata do
|
|
54
53
|
end
|
55
54
|
|
56
55
|
context "where there is no description arg that looks like a method signature" do
|
57
|
-
let(:
|
58
|
-
{
|
59
|
-
example_group: {
|
60
|
-
description_args: [klass.to_s]
|
61
|
-
}
|
62
|
-
}
|
63
|
-
end
|
56
|
+
let(:method_signature_string) { 'to_s()=>String' }
|
64
57
|
|
65
58
|
it "should raise an error" do
|
66
|
-
expect(-> { subject.method_signature_string }).to raise_error
|
59
|
+
expect(-> { subject.method_signature_string }).to raise_error(
|
60
|
+
StandardError, "The VerifiedDouble contract spec method 'Object' is
|
61
|
+
invalid.
|
62
|
+
The method must start with # or .".gsub(/\s+/, ' ')
|
63
|
+
)
|
67
64
|
end
|
68
65
|
end
|
69
66
|
end
|
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.8.
|
4
|
+
version: 0.8.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: 2014-
|
11
|
+
date: 2014-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|