lawyer 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 68b5a4c4e55ef1cf00ad9bfdbdf03f369f6365ae
4
- data.tar.gz: 32c4b7675c0e0182b154a527b5918daef0d3a866
3
+ metadata.gz: 9417f6d465de3ba5d89b5a2c4f296c9e5f597b93
4
+ data.tar.gz: bd222e59bfb602d59c35df1b661235922d136699
5
5
  SHA512:
6
- metadata.gz: 731191cb5a2171bd315304dc12f4f94ca87c27a5f29d2aec6c36e3940922c6ee27171a79d444d6dde8b0c97c174a94c1cd62eefdf9302bca32a4983881e248f7
7
- data.tar.gz: ea6b72a04a77d4b8fd2f3c7f49648a5afb7f233a335985c4db7c18290f5c8deedbe9861bdcc70a0c12db5e0146b6df8e0fae1b10c59f291a61215e74ed876c03
6
+ metadata.gz: a3c6d46c93ab74a229181ecf39eac71cdf96661e432d8704083270357cf73517774e56d355679b6d9d206e252166e0f2603e78cf1b76f45f16d5571f22ce5265
7
+ data.tar.gz: 7c0956931d5f270f57cc2600a9435eef3011d9f37b5d1b4a011c07d522b3cfd2f24d8712228e552096baaad60a635eb9540fbfd9cb0e831e5b1429645fc5e002
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Lawyer
2
2
 
3
+
4
+ ![Strong Duck Typing](https://raw.github.com/jcinnamond/lawyer/master/lawyer.jpg)
5
+
3
6
  Strong Duck Typing for Ruby.
4
7
 
5
8
  Lawyer allows you to create contracts that specify how an object behaves.
data/lawyer.jpg ADDED
Binary file
@@ -1,10 +1,15 @@
1
1
  module Lawyer
2
2
  module RSpec
3
3
  module ContractDouble
4
- def contract_double(contract)
4
+ def contract_double(contract, return_values = {})
5
5
  methods = {}
6
6
  contract.clauses.each do |clause|
7
- methods[clause.name] = true
7
+ return_value = if return_values.has_key?(clause.name.to_sym)
8
+ return_values[clause.name.to_sym]
9
+ else
10
+ true
11
+ end
12
+ methods[clause.name] = return_value
8
13
  end
9
14
  double(contract.name, methods)
10
15
  end
@@ -1,3 +1,3 @@
1
1
  module Lawyer
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
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.7
4
+ version: 0.0.8
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-23 00:00:00.000000000 Z
11
+ date: 2014-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,6 +66,7 @@ files:
66
66
  - README.md
67
67
  - Rakefile
68
68
  - lawyer.gemspec
69
+ - lawyer.jpg
69
70
  - lib/lawyer.rb
70
71
  - lib/lawyer/broken_contract.rb
71
72
  - lib/lawyer/clause.rb