hardmock 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +4 -3
- data/lib/hardmock.rb +4 -4
- data/lib/method_cleanout.rb +1 -1
- data/test/functional/hardmock_test.rb +8 -8
- metadata +23 -22
data/Rakefile
CHANGED
@@ -4,8 +4,9 @@ require 'rake/rdoctask'
|
|
4
4
|
require 'rubygems'
|
5
5
|
require 'rake/gempackagetask'
|
6
6
|
require 'rake/contrib/sshpublisher'
|
7
|
+
require 'hoe'
|
7
8
|
|
8
|
-
HARDMOCK_VERSION = "1.
|
9
|
+
HARDMOCK_VERSION = "1.2.0"
|
9
10
|
|
10
11
|
task :default => [ :alltests ]
|
11
12
|
|
@@ -39,6 +40,8 @@ task :upload_doc => :rerdoc do
|
|
39
40
|
sh "scp -r homepage/* rubyforge.org:/var/www/gforge-projects/hardmock/"
|
40
41
|
end
|
41
42
|
|
43
|
+
|
44
|
+
|
42
45
|
gem_spec = Gem::Specification.new do | s |
|
43
46
|
s.name = "hardmock"
|
44
47
|
s.version = HARDMOCK_VERSION
|
@@ -49,7 +52,6 @@ gem_spec = Gem::Specification.new do | s |
|
|
49
52
|
s.rubyforge_project = 'hardmock'
|
50
53
|
s.homepage = "http://hardmock.rubyforge.org"
|
51
54
|
s.autorequire = 'hardmock'
|
52
|
-
|
53
55
|
|
54
56
|
s.files = FileList['{lib,test}/**/*.rb', '[A-Z]*'].exclude('TODO').to_a
|
55
57
|
|
@@ -58,7 +60,6 @@ gem_spec = Gem::Specification.new do | s |
|
|
58
60
|
|
59
61
|
s.has_rdoc = true
|
60
62
|
s.extra_rdoc_files = ["README","CHANGES","LICENSE"]
|
61
|
-
# s.rdoc_options << '--title' << 'Harmock' << '--main' << 'README' << '--line-numbers'
|
62
63
|
add_rdoc_options(s.rdoc_options)
|
63
64
|
end
|
64
65
|
|
data/lib/hardmock.rb
CHANGED
@@ -209,10 +209,10 @@ module Hardmock
|
|
209
209
|
# If there ARE args, we set up the expectation right here and return it
|
210
210
|
expector.send(args.shift.to_sym, *args, &block)
|
211
211
|
end
|
212
|
-
|
213
|
-
def expect(*args, &block) #:nodoc:
|
214
|
-
raise DeprecationError.new("Please use 'expects' instead of 'expect'. Sorry about the inconvenience.")
|
215
|
-
end
|
212
|
+
alias_method :expect, :expects
|
213
|
+
# def expect(*args, &block) #:nodoc:
|
214
|
+
# raise DeprecationError.new("Please use 'expects' instead of 'expect'. Sorry about the inconvenience.")
|
215
|
+
# end
|
216
216
|
|
217
217
|
# Special-case convenience: #trap sets up an expectation for a method
|
218
218
|
# that will take a block. That block, when sent to the expected method, will
|
data/lib/method_cleanout.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
module Hardmock #:nodoc:
|
3
3
|
module MethodCleanout #:nodoc:
|
4
|
-
SACRED_METHODS = %w|__id__ __send__ equal? object_id send nil? class kind_of? respond_to
|
4
|
+
SACRED_METHODS = %w|__id__ __send__ equal? object_id send nil? class kind_of? respond_to? inspect|
|
5
5
|
|
6
6
|
def self.included(base) #:nodoc:
|
7
7
|
base.class_eval do
|
@@ -351,15 +351,8 @@ class HardmockTest < Test::Unit::TestCase
|
|
351
351
|
assert_equal false, @car.ignition_on?, "Should be false"
|
352
352
|
end
|
353
353
|
|
354
|
-
def test_should_raise_deprecation_error_when_old_expect_called
|
355
|
-
create_mock :foo
|
356
|
-
assert_error Hardmock::DeprecationError, /expect/,/expects/,/instead of/,/sorry/i do
|
357
|
-
@foo.expect.something
|
358
|
-
end
|
359
|
-
end
|
360
|
-
|
361
354
|
def test_should_be_able_to_mock_methods_inherited_from_object
|
362
|
-
target_methods = %w|to_s
|
355
|
+
target_methods = %w|to_s instance_eval instance_variables id clone display dup eql? ==|
|
363
356
|
create_mock :foo
|
364
357
|
target_methods.each do |m|
|
365
358
|
eval %{@foo.expects(m, "some stuff")}
|
@@ -367,5 +360,12 @@ class HardmockTest < Test::Unit::TestCase
|
|
367
360
|
end
|
368
361
|
end
|
369
362
|
|
363
|
+
def test_should_support_expect_and_should_receive_as_aliases_for_expects
|
364
|
+
create_mock :foo
|
365
|
+
@foo.expect.boomboom
|
366
|
+
@foo.boomboom
|
367
|
+
verify_mocks
|
368
|
+
end
|
369
|
+
|
370
370
|
end
|
371
371
|
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.
|
2
|
+
rubygems_version: 0.9.0
|
3
3
|
specification_version: 1
|
4
4
|
name: hardmock
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.
|
7
|
-
date: 2006-12-
|
6
|
+
version: 1.2.0
|
7
|
+
date: 2006-12-19 00:00:00 -05:00
|
8
8
|
summary: A strict, ordered, expectation-oriented mock object library.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -25,41 +25,42 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
|
|
25
25
|
platform: ruby
|
26
26
|
signing_key:
|
27
27
|
cert_chain:
|
28
|
+
post_install_message:
|
28
29
|
authors:
|
29
30
|
- David Crosby
|
30
31
|
files:
|
31
32
|
- lib/hardmock.rb
|
32
33
|
- lib/method_cleanout.rb
|
33
34
|
- test/test_helper.rb
|
34
|
-
- test/
|
35
|
-
- test/
|
35
|
+
- test/functional/assert_error_test.rb
|
36
|
+
- test/functional/auto_verify_test.rb
|
37
|
+
- test/functional/direct_mock_usage_test.rb
|
38
|
+
- test/functional/hardmock_test.rb
|
39
|
+
- test/unit/expectation_builder_test.rb
|
40
|
+
- test/unit/expector_test.rb
|
36
41
|
- test/unit/method_cleanout_test.rb
|
37
|
-
- test/unit/trapper_test.rb
|
38
42
|
- test/unit/mock_control_test.rb
|
39
|
-
- test/unit/
|
43
|
+
- test/unit/mock_test.rb
|
40
44
|
- test/unit/simple_expectation_test.rb
|
41
|
-
- test/unit/
|
42
|
-
- test/
|
43
|
-
-
|
44
|
-
- test/functional/assert_error_test.rb
|
45
|
-
- test/functional/auto_verify_test.rb
|
45
|
+
- test/unit/trapper_test.rb
|
46
|
+
- test/unit/verify_error_test.rb
|
47
|
+
- CHANGES
|
46
48
|
- LICENSE
|
47
49
|
- Rakefile
|
48
50
|
- README
|
49
|
-
- CHANGES
|
50
51
|
test_files:
|
51
|
-
- test/
|
52
|
-
- test/
|
52
|
+
- test/functional/assert_error_test.rb
|
53
|
+
- test/functional/auto_verify_test.rb
|
54
|
+
- test/functional/direct_mock_usage_test.rb
|
55
|
+
- test/functional/hardmock_test.rb
|
56
|
+
- test/unit/expectation_builder_test.rb
|
57
|
+
- test/unit/expector_test.rb
|
53
58
|
- test/unit/method_cleanout_test.rb
|
54
|
-
- test/unit/trapper_test.rb
|
55
59
|
- test/unit/mock_control_test.rb
|
56
|
-
- test/unit/
|
60
|
+
- test/unit/mock_test.rb
|
57
61
|
- test/unit/simple_expectation_test.rb
|
58
|
-
- test/unit/
|
59
|
-
- test/
|
60
|
-
- test/functional/hardmock_test.rb
|
61
|
-
- test/functional/assert_error_test.rb
|
62
|
-
- test/functional/auto_verify_test.rb
|
62
|
+
- test/unit/trapper_test.rb
|
63
|
+
- test/unit/verify_error_test.rb
|
63
64
|
rdoc_options:
|
64
65
|
- --line-numbers
|
65
66
|
- --inline-source
|