aidmock 0.1.0

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.
@@ -0,0 +1,57 @@
1
+ # Copyright (c) 2011 Wilker Lúcio
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ # of this software and associated documentation files (the "Software"), to deal
5
+ # in the Software without restriction, including without limitation the rights
6
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ # copies of the Software, and to permit persons to whom the Software is
8
+ # furnished to do so, subject to the following conditions:
9
+ #
10
+ # The above copyright notice and this permission notice shall be included in
11
+ # all copies or substantial portions of the Software.
12
+ #
13
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ # THE SOFTWARE.
20
+
21
+ $: << File.expand_path("../../lib", __FILE__)
22
+
23
+ require 'aidmock'
24
+
25
+ RSpec::Matchers.define :have_mock_result do |value|
26
+ match do |framework|
27
+ framework.mocks[0].result == value
28
+ end
29
+
30
+ failure_message_for_should do |framework|
31
+ "expected the result to be #{value}, got #{framework.mocks[0].result.inspect}"
32
+ end
33
+ end
34
+
35
+ RSpec::Matchers.define :have_mock_arguments do |value|
36
+ match do |framework|
37
+ framework.mocks[0].arguments == value
38
+ end
39
+
40
+ failure_message_for_should do |framework|
41
+ "expected the arguments to be #{value}, got #{framework.mocks[0].arguments.inspect}"
42
+ end
43
+ end
44
+
45
+ RSpec::Matchers.define :matches do |value|
46
+ match do |matcher|
47
+ matcher.match? value
48
+ end
49
+
50
+ failure_message_for_should do |matcher|
51
+ %{expected the matcher #{matcher.class.name} to matches #{value.inspect}}
52
+ end
53
+
54
+ failure_message_for_should_not do |matcher|
55
+ %{expected the matcher #{matcher.class.name} to don't matches #{value.inspect}}
56
+ end
57
+ end
metadata ADDED
@@ -0,0 +1,95 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: aidmock
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 0
9
+ version: 0.1.0
10
+ platform: ruby
11
+ authors:
12
+ - Wilker Lucio
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-01-10 00:00:00 -03:00
18
+ default_executable:
19
+ dependencies: []
20
+
21
+ description: Aidmock, safe mocking and interfacing for Ruby
22
+ email: wilkerlucio@gmail.com
23
+ executables: []
24
+
25
+ extensions: []
26
+
27
+ extra_rdoc_files:
28
+ - README.textile
29
+ files:
30
+ - .gitignore
31
+ - Gemfile
32
+ - Gemfile.lock
33
+ - README.textile
34
+ - Rakefile
35
+ - VERSION
36
+ - aidmock.gemspec
37
+ - examples/mock_spec.rb
38
+ - lib/aidmock.rb
39
+ - lib/aidmock/basic_object.rb
40
+ - lib/aidmock/errors.rb
41
+ - lib/aidmock/frameworks.rb
42
+ - lib/aidmock/frameworks/rspec.rb
43
+ - lib/aidmock/interface.rb
44
+ - lib/aidmock/matchers.rb
45
+ - lib/aidmock/method_descriptor.rb
46
+ - lib/aidmock/sanity.rb
47
+ - lib/aidmock/void_class.rb
48
+ - spec/aidmock/frameworks/rspec_spec.rb
49
+ - spec/aidmock/interface_spec.rb
50
+ - spec/aidmock/matchers_spec.rb
51
+ - spec/aidmock/method_descriptor_spec.rb
52
+ - spec/aidmock/sanity_spec.rb
53
+ - spec/aidmock_spec.rb
54
+ - spec/spec_helper.rb
55
+ has_rdoc: true
56
+ homepage: http://github.com/wilkerlucio/aidmock
57
+ licenses: []
58
+
59
+ post_install_message:
60
+ rdoc_options:
61
+ - --charset=UTF-8
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ segments:
70
+ - 0
71
+ version: "0"
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ segments:
78
+ - 0
79
+ version: "0"
80
+ requirements: []
81
+
82
+ rubyforge_project:
83
+ rubygems_version: 1.3.7
84
+ signing_key:
85
+ specification_version: 3
86
+ summary: Aidmock, safe mocking and interfacing for Ruby
87
+ test_files:
88
+ - spec/aidmock/frameworks/rspec_spec.rb
89
+ - spec/aidmock/interface_spec.rb
90
+ - spec/aidmock/matchers_spec.rb
91
+ - spec/aidmock/method_descriptor_spec.rb
92
+ - spec/aidmock/sanity_spec.rb
93
+ - spec/aidmock_spec.rb
94
+ - spec/spec_helper.rb
95
+ - examples/mock_spec.rb