lawyer 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lawyer/clause.rb +1 -1
- data/lib/lawyer/version.rb +1 -1
- data/spec/lib/lawyer/contract_spec.rb +26 -0
- 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: 68b5a4c4e55ef1cf00ad9bfdbdf03f369f6365ae
|
4
|
+
data.tar.gz: 32c4b7675c0e0182b154a527b5918daef0d3a866
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 731191cb5a2171bd315304dc12f4f94ca87c27a5f29d2aec6c36e3940922c6ee27171a79d444d6dde8b0c97c174a94c1cd62eefdf9302bca32a4983881e248f7
|
7
|
+
data.tar.gz: ea6b72a04a77d4b8fd2f3c7f49648a5afb7f233a335985c4db7c18290f5c8deedbe9861bdcc70a0c12db5e0146b6df8e0fae1b10c59f291a61215e74ed876c03
|
data/lib/lawyer/clause.rb
CHANGED
data/lib/lawyer/version.rb
CHANGED
@@ -4,6 +4,32 @@ class TestContract < Lawyer::Contract
|
|
4
4
|
confirm :pung => [:name, :size]
|
5
5
|
end
|
6
6
|
|
7
|
+
class TestInitialize < Lawyer::Contract
|
8
|
+
confirm :initialize => [:arg]
|
9
|
+
end
|
10
|
+
|
11
|
+
describe TestInitialize do
|
12
|
+
before :each do
|
13
|
+
Object.send(:remove_const, :TestObjectNew) if Object.const_defined?(:TestObjectNew)
|
14
|
+
end
|
15
|
+
|
16
|
+
it "does not raise an exception is the contact is satisified" do
|
17
|
+
class TestObjectNew
|
18
|
+
def initialize(arg:)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
expect { TestInitialize.check!(TestObjectNew) }.not_to raise_error
|
23
|
+
end
|
24
|
+
|
25
|
+
it "raises an exception if the signature is wrong" do
|
26
|
+
class TestObjectNew; end
|
27
|
+
|
28
|
+
expect { TestInitialize.check!(TestObjectNew) }.to raise_error(Lawyer::BrokenContract)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
|
7
33
|
describe TestContract do
|
8
34
|
before :each do
|
9
35
|
# Stop modifications to the TestObject from leaking into other specs.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lawyer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Cinnamond
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|