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.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/.autotest +3 -0
  3. data/.gitignore +14 -0
  4. data/.togglerc +7 -0
  5. data/.travis.yml +5 -0
  6. data/.yardopts +2 -0
  7. data/CHANGES +11 -0
  8. data/Gemfile +1 -4
  9. data/README.md +39 -11
  10. data/Rakefile +6 -217
  11. data/doc/examples/rspec_examples_spec.rb +244 -0
  12. data/doc/examples/test_unit_examples_test.rb +240 -0
  13. data/doc/jamis.rb +591 -0
  14. data/flexmock.gemspec +33 -0
  15. data/lib/flexmock.rb +0 -1
  16. data/lib/flexmock/composite_expectation.rb +1 -1
  17. data/lib/flexmock/core.rb +3 -7
  18. data/lib/flexmock/core_class_methods.rb +5 -1
  19. data/lib/flexmock/default_framework_adapter.rb +2 -2
  20. data/lib/flexmock/expectation.rb +29 -3
  21. data/lib/flexmock/expectation_director.rb +1 -1
  22. data/lib/flexmock/minitest.rb +13 -0
  23. data/lib/flexmock/minitest_extensions.rb +26 -0
  24. data/lib/flexmock/minitest_integration.rb +111 -0
  25. data/lib/flexmock/mock_container.rb +1 -2
  26. data/lib/flexmock/partial_mock.rb +61 -104
  27. data/lib/flexmock/recorder.rb +1 -2
  28. data/lib/flexmock/rspec.rb +6 -3
  29. data/lib/flexmock/test_unit_integration.rb +14 -0
  30. data/lib/flexmock/validators.rb +5 -4
  31. data/lib/flexmock/version.rb +1 -9
  32. data/rakelib/metrics.rake +40 -0
  33. data/rakelib/preview.rake +4 -0
  34. data/rakelib/tags.rake +18 -0
  35. data/todo.txt +20 -0
  36. metadata +61 -86
  37. data/Gemfile.lock +0 -20
  38. data/doc/examples/rspec_examples_spec.rdoc +0 -245
  39. data/doc/examples/test_unit_examples_test.rdoc +0 -241
  40. data/test/aliasing_test.rb +0 -66
  41. data/test/assert_spy_called_test.rb +0 -119
  42. data/test/base_class_test.rb +0 -71
  43. data/test/based_partials_test.rb +0 -51
  44. data/test/container_methods_test.rb +0 -118
  45. data/test/default_framework_adapter_test.rb +0 -38
  46. data/test/demeter_mocking_test.rb +0 -191
  47. data/test/deprecated_methods_test.rb +0 -225
  48. data/test/examples_from_readme_test.rb +0 -157
  49. data/test/expectation_description_test.rb +0 -80
  50. data/test/extended_should_receive_test.rb +0 -69
  51. data/test/flexmodel_test.rb +0 -54
  52. data/test/mock_builder_test.rb +0 -68
  53. data/test/naming_test.rb +0 -84
  54. data/test/new_instances_test.rb +0 -215
  55. data/test/object_extensions_test.rb +0 -25
  56. data/test/partial_mock_test.rb +0 -458
  57. data/test/record_mode_test.rb +0 -158
  58. data/test/redirect_error.rb +0 -16
  59. data/test/rspec_integration/integration_spec.rb +0 -56
  60. data/test/rspec_integration/spy_example_spec.rb +0 -207
  61. data/test/samples_test.rb +0 -283
  62. data/test/should_ignore_missing_test.rb +0 -84
  63. data/test/should_receive_test.rb +0 -1155
  64. data/test/spys_test.rb +0 -215
  65. data/test/symbol_extensions_test.rb +0 -8
  66. data/test/test_class_extensions.rb +0 -34
  67. data/test/test_setup.rb +0 -92
  68. data/test/test_unit_integration/auto_test_unit_test.rb +0 -42
  69. data/test/test_unit_integration/minitest_teardown_test.rb +0 -14
  70. data/test/tu_integration_test.rb +0 -99
  71. data/test/undefined_test.rb +0 -87
@@ -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