flexmock 1.3.3 → 2.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.autotest +3 -0
- data/.gitignore +14 -0
- data/.togglerc +7 -0
- data/.travis.yml +5 -0
- data/.yardopts +2 -0
- data/CHANGES +11 -0
- data/Gemfile +1 -4
- data/README.md +39 -11
- data/Rakefile +6 -217
- data/doc/examples/rspec_examples_spec.rb +244 -0
- data/doc/examples/test_unit_examples_test.rb +240 -0
- data/doc/jamis.rb +591 -0
- data/flexmock.gemspec +33 -0
- data/lib/flexmock.rb +0 -1
- data/lib/flexmock/composite_expectation.rb +1 -1
- data/lib/flexmock/core.rb +3 -7
- data/lib/flexmock/core_class_methods.rb +5 -1
- data/lib/flexmock/default_framework_adapter.rb +2 -2
- data/lib/flexmock/expectation.rb +29 -3
- data/lib/flexmock/expectation_director.rb +1 -1
- data/lib/flexmock/minitest.rb +13 -0
- data/lib/flexmock/minitest_extensions.rb +26 -0
- data/lib/flexmock/minitest_integration.rb +111 -0
- data/lib/flexmock/mock_container.rb +1 -2
- data/lib/flexmock/partial_mock.rb +61 -104
- data/lib/flexmock/recorder.rb +1 -2
- data/lib/flexmock/rspec.rb +6 -3
- data/lib/flexmock/test_unit_integration.rb +14 -0
- data/lib/flexmock/validators.rb +5 -4
- data/lib/flexmock/version.rb +1 -9
- data/rakelib/metrics.rake +40 -0
- data/rakelib/preview.rake +4 -0
- data/rakelib/tags.rake +18 -0
- data/todo.txt +20 -0
- metadata +61 -86
- data/Gemfile.lock +0 -20
- data/doc/examples/rspec_examples_spec.rdoc +0 -245
- data/doc/examples/test_unit_examples_test.rdoc +0 -241
- data/test/aliasing_test.rb +0 -66
- data/test/assert_spy_called_test.rb +0 -119
- data/test/base_class_test.rb +0 -71
- data/test/based_partials_test.rb +0 -51
- data/test/container_methods_test.rb +0 -118
- data/test/default_framework_adapter_test.rb +0 -38
- data/test/demeter_mocking_test.rb +0 -191
- data/test/deprecated_methods_test.rb +0 -225
- data/test/examples_from_readme_test.rb +0 -157
- data/test/expectation_description_test.rb +0 -80
- data/test/extended_should_receive_test.rb +0 -69
- data/test/flexmodel_test.rb +0 -54
- data/test/mock_builder_test.rb +0 -68
- data/test/naming_test.rb +0 -84
- data/test/new_instances_test.rb +0 -215
- data/test/object_extensions_test.rb +0 -25
- data/test/partial_mock_test.rb +0 -458
- data/test/record_mode_test.rb +0 -158
- data/test/redirect_error.rb +0 -16
- data/test/rspec_integration/integration_spec.rb +0 -56
- data/test/rspec_integration/spy_example_spec.rb +0 -207
- data/test/samples_test.rb +0 -283
- data/test/should_ignore_missing_test.rb +0 -84
- data/test/should_receive_test.rb +0 -1155
- data/test/spys_test.rb +0 -215
- data/test/symbol_extensions_test.rb +0 -8
- data/test/test_class_extensions.rb +0 -34
- data/test/test_setup.rb +0 -92
- data/test/test_unit_integration/auto_test_unit_test.rb +0 -42
- data/test/test_unit_integration/minitest_teardown_test.rb +0 -14
- data/test/tu_integration_test.rb +0 -99
- data/test/undefined_test.rb +0 -87
data/test/undefined_test.rb
DELETED
@@ -1,87 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
#---
|
4
|
-
# Copyright 2003-2013 by Jim Weirich (jim.weirich@gmail.com).
|
5
|
-
# All rights reserved.
|
6
|
-
|
7
|
-
# Permission is granted for use, copying, modification, distribution,
|
8
|
-
# and distribution of modified versions of this work as long as the
|
9
|
-
# above copyright notice is included.
|
10
|
-
#+++
|
11
|
-
|
12
|
-
require "test/test_setup"
|
13
|
-
|
14
|
-
class UndefinedTest < Test::Unit::TestCase
|
15
|
-
def test_undefined_method_calls_return_undefined
|
16
|
-
assert_undefined undefined.some_random_undefined_method
|
17
|
-
end
|
18
|
-
|
19
|
-
def test_equals
|
20
|
-
assert undefined == undefined
|
21
|
-
assert ! (undefined == Object.new)
|
22
|
-
end
|
23
|
-
|
24
|
-
def test_math_operators
|
25
|
-
assert_undefined undefined + 1
|
26
|
-
assert_undefined undefined - 1
|
27
|
-
assert_undefined undefined * 1
|
28
|
-
assert_undefined undefined / 1
|
29
|
-
assert_undefined undefined ** 1
|
30
|
-
end
|
31
|
-
|
32
|
-
def test_math_operators_reversed
|
33
|
-
assert_undefined 1 + undefined
|
34
|
-
assert_undefined 1 - undefined
|
35
|
-
assert_undefined 1 * undefined
|
36
|
-
assert_undefined 1 / undefined
|
37
|
-
assert_undefined 2 ** undefined
|
38
|
-
end
|
39
|
-
|
40
|
-
def test_comparisons
|
41
|
-
assert_undefined undefined < 1
|
42
|
-
assert_undefined undefined <= 1
|
43
|
-
assert_undefined undefined > 1
|
44
|
-
assert_undefined undefined >= 1
|
45
|
-
assert_undefined undefined <=> 1
|
46
|
-
end
|
47
|
-
|
48
|
-
def test_comparisons_reversed
|
49
|
-
assert_undefined 1 < undefined
|
50
|
-
assert_undefined 1 <= undefined
|
51
|
-
assert_undefined 1 > undefined
|
52
|
-
assert_undefined 1 >= undefined
|
53
|
-
assert_undefined 1 <=> undefined
|
54
|
-
end
|
55
|
-
|
56
|
-
def test_base_level_methods
|
57
|
-
assert_kind_of FlexMock::Undefined, undefined
|
58
|
-
end
|
59
|
-
|
60
|
-
def test_cant_create_a_new_undefined
|
61
|
-
assert_raises(NoMethodError) do FlexMock::Undefined.new end
|
62
|
-
end
|
63
|
-
|
64
|
-
def test_cant_clone_undefined
|
65
|
-
assert_undefined undefined.clone
|
66
|
-
assert_equal undefined.__id__, undefined.clone.__id__
|
67
|
-
end
|
68
|
-
|
69
|
-
def test_string_representations
|
70
|
-
assert_equal "-UNDEFINED-", undefined.to_s
|
71
|
-
assert_equal "-UNDEFINED-", undefined.inspect
|
72
|
-
end
|
73
|
-
|
74
|
-
def test_undefined_is_not_nil
|
75
|
-
assert ! undefined.nil?
|
76
|
-
end
|
77
|
-
|
78
|
-
private
|
79
|
-
|
80
|
-
def assert_undefined(obj)
|
81
|
-
assert undefined == obj
|
82
|
-
end
|
83
|
-
|
84
|
-
def undefined
|
85
|
-
FlexMock.undefined
|
86
|
-
end
|
87
|
-
end
|