lookout 2.3.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README +351 -181
- data/Rakefile +20 -5
- data/lib/lookout-3.0.rb +138 -0
- data/lib/lookout-3.0/actual.rb +30 -0
- data/lib/lookout-3.0/actual/method.rb +31 -0
- data/lib/lookout-3.0/actual/not.rb +13 -0
- data/lib/lookout-3.0/actual/not/method.rb +10 -0
- data/lib/lookout-3.0/aphonic.rb +44 -0
- data/lib/lookout-3.0/diff.rb +29 -0
- data/lib/{lookout → lookout-3.0}/diff/algorithms.rb +1 -1
- data/lib/lookout-3.0/diff/algorithms/difflib.rb +62 -0
- data/lib/lookout-3.0/diff/algorithms/difflib/position.rb +63 -0
- data/lib/{lookout/diff/algorithms/difflib/position/to.rb → lookout-3.0/diff/algorithms/difflib/position/new.rb} +8 -17
- data/lib/lookout-3.0/diff/formats.rb +5 -0
- data/lib/lookout-3.0/diff/formats/inline.rb +43 -0
- data/lib/lookout-3.0/diff/formats/set.rb +48 -0
- data/lib/lookout-3.0/diff/formats/unified.rb +56 -0
- data/lib/lookout-3.0/diff/group.rb +57 -0
- data/lib/lookout-3.0/diff/groups.rb +47 -0
- data/lib/lookout-3.0/diff/match.rb +31 -0
- data/lib/lookout-3.0/diff/operation.rb +41 -0
- data/lib/lookout-3.0/diff/operations.rb +35 -0
- data/lib/lookout-3.0/diff/operations/copy.rb +25 -0
- data/lib/lookout-3.0/diff/operations/delete.rb +5 -0
- data/lib/lookout-3.0/diff/operations/insert.rb +5 -0
- data/lib/lookout-3.0/diff/operations/replace.rb +6 -0
- data/lib/lookout-3.0/diff/slice.rb +97 -0
- data/lib/lookout-3.0/difference.rb +10 -0
- data/lib/lookout-3.0/difference/array.rb +22 -0
- data/lib/lookout-3.0/difference/exception.rb +40 -0
- data/lib/lookout-3.0/difference/hash.rb +31 -0
- data/lib/lookout-3.0/difference/lookout.rb +5 -0
- data/lib/lookout-3.0/difference/lookout/actual.rb +6 -0
- data/lib/lookout-3.0/difference/lookout/actual/method.rb +13 -0
- data/lib/lookout-3.0/difference/lookout/actual/not.rb +6 -0
- data/lib/lookout-3.0/difference/lookout/actual/not/method.rb +9 -0
- data/lib/lookout-3.0/difference/lookout/output.rb +8 -0
- data/lib/lookout-3.0/difference/lookout/reception.rb +21 -0
- data/lib/lookout-3.0/difference/lookout/warning.rb +9 -0
- data/lib/lookout-3.0/difference/module.rb +12 -0
- data/lib/lookout-3.0/difference/object.rb +73 -0
- data/lib/lookout-3.0/difference/range.rb +12 -0
- data/lib/lookout-3.0/difference/regexp.rb +12 -0
- data/lib/lookout-3.0/difference/string.rb +21 -0
- data/lib/lookout-3.0/difference/symbol.rb +21 -0
- data/lib/lookout-3.0/encode.rb +20 -0
- data/lib/lookout-3.0/exception.rb +79 -0
- data/lib/lookout-3.0/exception/backtrace.rb +65 -0
- data/lib/lookout-3.0/exception/unknown.rb +25 -0
- data/lib/lookout-3.0/expect.rb +32 -0
- data/lib/lookout-3.0/expect/classes.rb +6 -0
- data/lib/lookout-3.0/expect/classes/exception.rb +27 -0
- data/lib/lookout-3.0/expect/exception.rb +30 -0
- data/lib/lookout-3.0/expect/object.rb +54 -0
- data/lib/lookout-3.0/expect/object/context.rb +149 -0
- data/lib/lookout-3.0/expectations.rb +69 -0
- data/lib/lookout-3.0/expectations/context.rb +52 -0
- data/lib/lookout-3.0/expected.rb +10 -0
- data/lib/lookout-3.0/expected/array.rb +16 -0
- data/lib/lookout-3.0/expected/classes.rb +5 -0
- data/lib/lookout-3.0/expected/classes/exception.rb +14 -0
- data/lib/lookout-3.0/expected/exception.rb +46 -0
- data/lib/lookout-3.0/expected/falseclass.rb +9 -0
- data/lib/lookout-3.0/expected/hash.rb +14 -0
- data/lib/lookout-3.0/expected/lookout.rb +5 -0
- data/lib/lookout-3.0/expected/lookout/actual.rb +5 -0
- data/lib/lookout-3.0/expected/lookout/actual/method.rb +13 -0
- data/lib/lookout-3.0/expected/lookout/actual/not.rb +6 -0
- data/lib/lookout-3.0/expected/lookout/actual/not/method.rb +13 -0
- data/lib/lookout-3.0/expected/lookout/output.rb +26 -0
- data/lib/lookout-3.0/expected/lookout/reception.rb +24 -0
- data/lib/lookout-3.0/expected/lookout/warning.rb +29 -0
- data/lib/lookout-3.0/expected/module.rb +12 -0
- data/lib/lookout-3.0/expected/object.rb +30 -0
- data/lib/lookout-3.0/expected/range.rb +12 -0
- data/lib/lookout-3.0/expected/regexp.rb +12 -0
- data/lib/lookout-3.0/expected/string.rb +11 -0
- data/lib/lookout-3.0/expected/symbol.rb +21 -0
- data/lib/lookout-3.0/expected/trueclass.rb +9 -0
- data/lib/lookout-3.0/inspect.rb +45 -0
- data/lib/lookout-3.0/interfaces.rb +5 -0
- data/lib/lookout-3.0/interfaces/commandline.rb +109 -0
- data/lib/lookout-3.0/literal.rb +18 -0
- data/lib/lookout-3.0/mock.rb +24 -0
- data/lib/lookout-3.0/object.rb +6 -0
- data/lib/lookout-3.0/object/not.rb +16 -0
- data/lib/lookout-3.0/object/not/receive.rb +18 -0
- data/lib/lookout-3.0/object/to.rb +12 -0
- data/lib/lookout-3.0/object/to/receive.rb +18 -0
- data/lib/lookout-3.0/output.rb +20 -0
- data/lib/lookout-3.0/plugins.rb +7 -0
- data/lib/lookout-3.0/reception.rb +128 -0
- data/lib/lookout-3.0/reception/arguments.rb +20 -0
- data/lib/lookout-3.0/reception/arguments/any.rb +16 -0
- data/lib/lookout-3.0/reception/arguments/error.rb +5 -0
- data/lib/lookout-3.0/reception/arguments/list.rb +17 -0
- data/lib/lookout-3.0/reception/arguments/none.rb +6 -0
- data/lib/lookout-3.0/reception/error.rb +24 -0
- data/lib/lookout-3.0/result.rb +16 -0
- data/lib/lookout-3.0/results.rb +5 -0
- data/lib/lookout-3.0/results/error.rb +18 -0
- data/lib/lookout-3.0/results/failure.rb +15 -0
- data/lib/lookout-3.0/results/success.rb +7 -0
- data/lib/lookout-3.0/stub.rb +55 -0
- data/lib/lookout-3.0/version.rb +133 -0
- data/lib/lookout-3.0/warning.rb +40 -0
- data/test/unit/examples.rb +208 -83
- data/test/unit/{lookout.rb → lookout-3.0.rb} +0 -0
- data/test/unit/lookout-3.0/actual.rb +13 -0
- data/test/unit/lookout-3.0/actual/method.rb +31 -0
- data/test/unit/lookout-3.0/actual/not.rb +15 -0
- data/test/unit/lookout-3.0/actual/not/method.rb +7 -0
- data/test/unit/lookout-3.0/aphonic.rb +31 -0
- data/test/unit/{lookout → lookout-3.0}/diff.rb +0 -0
- data/test/unit/{lookout/diff/group.rb → lookout-3.0/diff/algorithms.rb} +0 -0
- data/test/unit/lookout-3.0/diff/algorithms/difflib.rb +56 -0
- data/test/unit/lookout-3.0/diff/algorithms/difflib/position.rb +92 -0
- data/test/unit/{lookout/diff/algorithms/difflib/position/to.rb → lookout-3.0/diff/algorithms/difflib/position/new.rb} +1 -2
- data/test/unit/{lookout/results.rb → lookout-3.0/diff/formats.rb} +0 -0
- data/test/unit/{lookout → lookout-3.0}/diff/formats/inline.rb +0 -0
- data/test/unit/lookout-3.0/diff/formats/set.rb +26 -0
- data/test/unit/{lookout → lookout-3.0}/diff/formats/unified.rb +0 -0
- data/test/unit/{lookout/results/error.rb → lookout-3.0/diff/group.rb} +0 -0
- data/test/unit/lookout-3.0/diff/groups.rb +102 -0
- data/test/unit/{lookout → lookout-3.0}/diff/match.rb +0 -0
- data/test/unit/lookout-3.0/diff/operation.rb +17 -0
- data/test/unit/lookout-3.0/diff/operations.rb +22 -0
- data/test/unit/lookout-3.0/diff/operations/copy.rb +50 -0
- data/test/unit/lookout-3.0/diff/operations/delete.rb +45 -0
- data/test/unit/lookout-3.0/diff/operations/insert.rb +45 -0
- data/test/unit/lookout-3.0/diff/operations/replace.rb +45 -0
- data/test/unit/lookout-3.0/diff/slice.rb +56 -0
- data/test/unit/{lookout/results/failures/behavior.rb → lookout-3.0/difference.rb} +0 -0
- data/test/unit/lookout-3.0/difference/array.rb +32 -0
- data/test/unit/lookout-3.0/difference/exception.rb +69 -0
- data/test/unit/lookout-3.0/difference/hash.rb +30 -0
- data/test/unit/{lookout/results/failures/state.rb → lookout-3.0/difference/lookout.rb} +0 -0
- data/test/unit/{lookout/results/fulfilled.rb → lookout-3.0/difference/lookout/actual.rb} +0 -0
- data/test/unit/lookout-3.0/difference/lookout/actual/method.rb +7 -0
- data/test/unit/{lookout/runners/console.rb → lookout-3.0/difference/lookout/actual/not.rb} +0 -0
- data/test/unit/lookout-3.0/difference/lookout/actual/not/method.rb +7 -0
- data/test/unit/lookout-3.0/difference/lookout/output.rb +11 -0
- data/test/unit/lookout-3.0/difference/lookout/reception.rb +11 -0
- data/test/unit/lookout-3.0/difference/lookout/warning.rb +11 -0
- data/test/unit/lookout-3.0/difference/module.rb +11 -0
- data/test/unit/lookout-3.0/difference/object.rb +31 -0
- data/test/unit/lookout-3.0/difference/range.rb +11 -0
- data/test/unit/lookout-3.0/difference/regexp.rb +11 -0
- data/test/unit/lookout-3.0/difference/string.rb +29 -0
- data/test/unit/lookout-3.0/difference/symbol.rb +11 -0
- data/test/unit/lookout-3.0/encode.rb +28 -0
- data/test/unit/lookout-3.0/exception.rb +107 -0
- data/test/unit/lookout-3.0/exception/backtrace.rb +75 -0
- data/test/unit/lookout-3.0/exception/unknown.rb +23 -0
- data/test/unit/lookout-3.0/expect.rb +15 -0
- data/test/unit/{lookout/ui/console.rb → lookout-3.0/expect/classes.rb} +0 -0
- data/test/unit/lookout-3.0/expect/classes/exception.rb +41 -0
- data/test/unit/lookout-3.0/expect/exception.rb +63 -0
- data/test/unit/lookout-3.0/expect/object.rb +55 -0
- data/test/unit/lookout-3.0/expect/object/context.rb +120 -0
- data/test/unit/lookout-3.0/expectations.rb +55 -0
- data/test/unit/lookout-3.0/expectations/context.rb +44 -0
- data/test/unit/lookout-3.0/expected.rb +4 -0
- data/test/unit/lookout-3.0/expected/array.rb +19 -0
- data/test/unit/lookout-3.0/expected/classes.rb +4 -0
- data/test/unit/lookout-3.0/expected/classes/exception.rb +7 -0
- data/test/unit/lookout-3.0/expected/exception.rb +24 -0
- data/test/unit/lookout-3.0/expected/falseclass.rb +23 -0
- data/test/unit/lookout-3.0/expected/hash.rb +23 -0
- data/test/unit/lookout-3.0/expected/lookout.rb +4 -0
- data/test/unit/lookout-3.0/expected/lookout/actual.rb +4 -0
- data/test/unit/lookout-3.0/expected/lookout/actual/method.rb +11 -0
- data/test/unit/lookout-3.0/expected/lookout/actual/not.rb +4 -0
- data/test/unit/lookout-3.0/expected/lookout/actual/not/method.rb +11 -0
- data/test/unit/lookout-3.0/expected/lookout/output.rb +27 -0
- data/test/unit/lookout-3.0/expected/lookout/reception.rb +25 -0
- data/test/unit/lookout-3.0/expected/lookout/warning.rb +48 -0
- data/test/unit/lookout-3.0/expected/module.rb +23 -0
- data/test/unit/lookout-3.0/expected/object.rb +24 -0
- data/test/unit/lookout-3.0/expected/range.rb +19 -0
- data/test/unit/lookout-3.0/expected/regexp.rb +19 -0
- data/test/unit/lookout-3.0/expected/string.rb +44 -0
- data/test/unit/lookout-3.0/expected/symbol.rb +35 -0
- data/test/unit/lookout-3.0/expected/trueclass.rb +23 -0
- data/test/unit/lookout-3.0/inspect.rb +39 -0
- data/test/unit/lookout-3.0/interfaces.rb +4 -0
- data/test/unit/lookout-3.0/interfaces/commandline.rb +4 -0
- data/test/unit/lookout-3.0/literal.rb +15 -0
- data/test/unit/lookout-3.0/mock.rb +22 -0
- data/test/unit/lookout-3.0/object.rb +4 -0
- data/test/unit/lookout-3.0/object/not.rb +7 -0
- data/test/unit/lookout-3.0/object/not/receive.rb +9 -0
- data/test/unit/lookout-3.0/object/to.rb +7 -0
- data/test/unit/lookout-3.0/object/to/receive.rb +9 -0
- data/test/unit/lookout-3.0/output.rb +31 -0
- data/test/unit/lookout-3.0/plugins.rb +4 -0
- data/test/unit/lookout-3.0/reception.rb +86 -0
- data/test/unit/lookout-3.0/reception/arguments.rb +23 -0
- data/test/unit/lookout-3.0/reception/arguments/any.rb +15 -0
- data/test/unit/lookout-3.0/reception/arguments/error.rb +4 -0
- data/test/unit/lookout-3.0/reception/arguments/list.rb +19 -0
- data/test/unit/lookout-3.0/reception/arguments/none.rb +15 -0
- data/test/unit/lookout-3.0/reception/error.rb +4 -0
- data/test/unit/lookout-3.0/result.rb +27 -0
- data/test/unit/lookout-3.0/results.rb +4 -0
- data/test/unit/lookout-3.0/results/error.rb +37 -0
- data/test/unit/lookout-3.0/results/failure.rb +21 -0
- data/test/unit/lookout-3.0/results/success.rb +4 -0
- data/test/unit/lookout-3.0/stub.rb +53 -0
- data/test/unit/lookout-3.0/version.rb +4 -0
- data/test/unit/lookout-3.0/warning.rb +47 -0
- metadata +1159 -456
- data/lib/lookout.rb +0 -30
- data/lib/lookout/aphonic.rb +0 -40
- data/lib/lookout/diff.rb +0 -10
- data/lib/lookout/diff/algorithms/difflib.rb +0 -38
- data/lib/lookout/diff/algorithms/difflib/position.rb +0 -92
- data/lib/lookout/diff/formats.rb +0 -7
- data/lib/lookout/diff/formats/hash.rb +0 -53
- data/lib/lookout/diff/formats/inline.rb +0 -39
- data/lib/lookout/diff/formats/unified.rb +0 -57
- data/lib/lookout/diff/group.rb +0 -61
- data/lib/lookout/diff/groups.rb +0 -34
- data/lib/lookout/diff/match.rb +0 -36
- data/lib/lookout/diff/operation.rb +0 -33
- data/lib/lookout/diff/operations.rb +0 -36
- data/lib/lookout/diff/operations/delete.rb +0 -9
- data/lib/lookout/diff/operations/equal.rb +0 -27
- data/lib/lookout/diff/operations/insert.rb +0 -9
- data/lib/lookout/diff/operations/replace.rb +0 -9
- data/lib/lookout/diff/range.rb +0 -91
- data/lib/lookout/equalities.rb +0 -13
- data/lib/lookout/equalities/array.rb +0 -22
- data/lib/lookout/equalities/boolean.rb +0 -9
- data/lib/lookout/equalities/hash.rb +0 -25
- data/lib/lookout/equalities/include.rb +0 -9
- data/lib/lookout/equalities/object.rb +0 -24
- data/lib/lookout/equalities/output.rb +0 -19
- data/lib/lookout/equalities/standarderror.rb +0 -32
- data/lib/lookout/equalities/string.rb +0 -19
- data/lib/lookout/equalities/warning.rb +0 -16
- data/lib/lookout/equality.rb +0 -36
- data/lib/lookout/expectation.rb +0 -69
- data/lib/lookout/expectations.rb +0 -49
- data/lib/lookout/expectations/behavior.rb +0 -20
- data/lib/lookout/expectations/line.rb +0 -29
- data/lib/lookout/expectations/state.rb +0 -31
- data/lib/lookout/expectations/state/warning.rb +0 -26
- data/lib/lookout/mock.rb +0 -20
- data/lib/lookout/mock/method.rb +0 -70
- data/lib/lookout/mock/method/arguments.rb +0 -33
- data/lib/lookout/mock/method/arguments/any.rb +0 -11
- data/lib/lookout/mock/method/arguments/anything.rb +0 -11
- data/lib/lookout/mock/method/arguments/list.rb +0 -15
- data/lib/lookout/mock/method/arguments/none.rb +0 -11
- data/lib/lookout/mock/method/arguments/one.rb +0 -11
- data/lib/lookout/mock/method/calls.rb +0 -11
- data/lib/lookout/mock/method/calls/class.rb +0 -21
- data/lib/lookout/mock/method/calls/exactly.rb +0 -28
- data/lib/lookout/mock/method/calls/instance.rb +0 -25
- data/lib/lookout/mock/method/calls/lower.rb +0 -22
- data/lib/lookout/mock/method/calls/upper.rb +0 -22
- data/lib/lookout/mock/methods.rb +0 -12
- data/lib/lookout/mock/object.rb +0 -12
- data/lib/lookout/object.rb +0 -11
- data/lib/lookout/output.rb +0 -21
- data/lib/lookout/rake/tasks.rb +0 -36
- data/lib/lookout/rake/tasks/gem.rb +0 -49
- data/lib/lookout/rake/tasks/tags.rb +0 -16
- data/lib/lookout/rake/tasks/test.rb +0 -46
- data/lib/lookout/rake/tasks/test/loader.rb +0 -22
- data/lib/lookout/recorder.rb +0 -45
- data/lib/lookout/recorder/not.rb +0 -11
- data/lib/lookout/recorder/tape.rb +0 -21
- data/lib/lookout/recorders.rb +0 -6
- data/lib/lookout/recorders/reception.rb +0 -47
- data/lib/lookout/recorders/state.rb +0 -35
- data/lib/lookout/result.rb +0 -13
- data/lib/lookout/results.rb +0 -25
- data/lib/lookout/results/error.rb +0 -18
- data/lib/lookout/results/error/exception.rb +0 -34
- data/lib/lookout/results/error/exception/backtrace.rb +0 -50
- data/lib/lookout/results/failure.rb +0 -16
- data/lib/lookout/results/failures.rb +0 -6
- data/lib/lookout/results/failures/behavior.rb +0 -5
- data/lib/lookout/results/failures/state.rb +0 -5
- data/lib/lookout/results/fulfilled.rb +0 -5
- data/lib/lookout/results/unsuccessful.rb +0 -31
- data/lib/lookout/runners.rb +0 -6
- data/lib/lookout/runners/console.rb +0 -49
- data/lib/lookout/runners/trackers.rb +0 -5
- data/lib/lookout/runners/trackers/failure.rb +0 -14
- data/lib/lookout/stub.rb +0 -18
- data/lib/lookout/stub/method.rb +0 -105
- data/lib/lookout/stub/methods.rb +0 -18
- data/lib/lookout/stub/object.rb +0 -11
- data/lib/lookout/ui.rb +0 -7
- data/lib/lookout/ui/console.rb +0 -19
- data/lib/lookout/ui/silent.rb +0 -9
- data/lib/lookout/version.rb +0 -5
- data/lib/lookout/warning.rb +0 -7
- data/lib/lookout/xml.rb +0 -17
- data/test/unit/lookout/diff/algorithms/difflib.rb +0 -56
- data/test/unit/lookout/diff/algorithms/difflib/position.rb +0 -92
- data/test/unit/lookout/diff/groups.rb +0 -102
- data/test/unit/lookout/diff/operations.rb +0 -22
- data/test/unit/lookout/diff/operations/delete.rb +0 -45
- data/test/unit/lookout/diff/operations/equal.rb +0 -45
- data/test/unit/lookout/diff/operations/insert.rb +0 -45
- data/test/unit/lookout/diff/operations/replace.rb +0 -45
- data/test/unit/lookout/diff/range.rb +0 -50
- data/test/unit/lookout/equality.rb +0 -113
- data/test/unit/lookout/expectation.rb +0 -47
- data/test/unit/lookout/expectations.rb +0 -36
- data/test/unit/lookout/expectations/behavior.rb +0 -35
- data/test/unit/lookout/expectations/line.rb +0 -29
- data/test/unit/lookout/expectations/state.rb +0 -29
- data/test/unit/lookout/mock/method.rb +0 -143
- data/test/unit/lookout/mock/method/arguments.rb +0 -57
- data/test/unit/lookout/mock/method/arguments/any.rb +0 -11
- data/test/unit/lookout/recorder.rb +0 -11
- data/test/unit/lookout/results/error/exception/backtrace.rb +0 -20
- data/test/unit/lookout/results/unsuccessful.rb +0 -9
- data/test/unit/lookout/runners/trackers/failure.rb +0 -30
- data/test/unit/lookout/stub/method.rb +0 -48
- data/test/unit/lookout/stub/methods.rb +0 -19
- data/test/unit/lookout/xml.rb +0 -55
@@ -1,35 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
Expectations do
|
4
|
-
expect [Lookout::Results::Failures::Behavior] do
|
5
|
-
Lookout::Results::Unsuccessful.new.tap{ |results|
|
6
|
-
Lookout::Expectations.new(results).expect Object.new.to.receive.dial('2125551212').twice do |phone|
|
7
|
-
phone.dial('2125551212')
|
8
|
-
end
|
9
|
-
}.entries
|
10
|
-
end
|
11
|
-
|
12
|
-
expect [Lookout::Results::Failures::Behavior] do
|
13
|
-
Lookout::Results::Unsuccessful.new.tap{ |results|
|
14
|
-
Lookout::Expectations.new(results).expect Object.new.to.receive.dial('2125551212').twice do |phone|
|
15
|
-
phone.dial('2125551212')
|
16
|
-
phone.dial('2125551212')
|
17
|
-
phone.dial('2125551212')
|
18
|
-
end
|
19
|
-
}.entries
|
20
|
-
end
|
21
|
-
|
22
|
-
expect [Lookout::Results::Failures::Behavior] do
|
23
|
-
Lookout::Results::Unsuccessful.new.tap{ |results|
|
24
|
-
Lookout::Expectations.new(results).expect(Object.new.to.receive.deal)
|
25
|
-
}.entries
|
26
|
-
end
|
27
|
-
|
28
|
-
expect [Lookout::Results::Error] do
|
29
|
-
Lookout::Results::Unsuccessful.new.tap{ |results|
|
30
|
-
Lookout::Expectations.new(results).expect(Object.new.to.receive.foo) do
|
31
|
-
raise StandardError
|
32
|
-
end
|
33
|
-
}.entries
|
34
|
-
end
|
35
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
Expectations do
|
4
|
-
expect 1 do
|
5
|
-
Lookout::Results::Unsuccessful.new.tap{ |results|
|
6
|
-
expectations = Lookout::Expectations::Line.new(__LINE__ + 1, results)
|
7
|
-
expectations.expect(1){ 2 }
|
8
|
-
expectations.expect(1){ 2 }
|
9
|
-
}.count
|
10
|
-
end
|
11
|
-
|
12
|
-
expect 1 do
|
13
|
-
Lookout::Results::Unsuccessful.new.tap{ |results|
|
14
|
-
expectations = Lookout::Expectations::Line.new(__LINE__ + 1, results)
|
15
|
-
expectations.expect(1){ 2 }
|
16
|
-
expectations.expect(1){ 2 }
|
17
|
-
expectations.flush
|
18
|
-
}.count
|
19
|
-
end
|
20
|
-
|
21
|
-
expect 1 do
|
22
|
-
Lookout::Results::Unsuccessful.new.tap{ |results|
|
23
|
-
expectations = Lookout::Expectations::Line.new(__LINE__ + 2, results)
|
24
|
-
expectations.expect(1){ 2 }
|
25
|
-
expectations.expect(1){ 2 }
|
26
|
-
expectations.flush
|
27
|
-
}.count
|
28
|
-
end
|
29
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
Expectations do
|
4
|
-
expect [Lookout::Results::Failures::State] do
|
5
|
-
Lookout::Results::Unsuccessful.new.tap{ |results|
|
6
|
-
Lookout::Expectations.new(results).expect(2){ 3 }
|
7
|
-
}.entries
|
8
|
-
end
|
9
|
-
|
10
|
-
expect [Lookout::Results::Error] do
|
11
|
-
Lookout::Results::Unsuccessful.new.tap{ |results|
|
12
|
-
Lookout::Expectations.new(results).expect(2){ stub(Object.new).two{ 2 }.twos }
|
13
|
-
}.entries
|
14
|
-
end
|
15
|
-
|
16
|
-
expect [Lookout::Results::Error] do
|
17
|
-
Lookout::Results::Unsuccessful.new.tap{ |results|
|
18
|
-
Lookout::Expectations.new(results).expect 1 do
|
19
|
-
Object.new.tap{ |o| o.expects.give_me_three(3){ 1 } }.give_me_three(stub).threes
|
20
|
-
end
|
21
|
-
}.entries
|
22
|
-
end
|
23
|
-
|
24
|
-
expect [] do
|
25
|
-
Lookout::Results::Unsuccessful.new.tap{ |results|
|
26
|
-
Lookout::Expectations.new(results).expect(NoMethodError){ Object.no_method }
|
27
|
-
}.entries
|
28
|
-
end
|
29
|
-
end
|
@@ -1,143 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
Expectations do
|
4
|
-
expect Lookout::Mock::Method do
|
5
|
-
Lookout::Mock::Method.new(stub, :a).never.verify
|
6
|
-
end
|
7
|
-
|
8
|
-
expect Lookout::Mock::Method::Calls::Error do
|
9
|
-
Lookout::Mock::Method.new(stub, :a).never.tap{ |m| m.call }.verify
|
10
|
-
end
|
11
|
-
|
12
|
-
expect Lookout::Mock::Method::Calls::Error do
|
13
|
-
Lookout::Mock::Method.new(stub, :a).never.tap{ |m| 2.times{ m.call } }.verify
|
14
|
-
end
|
15
|
-
|
16
|
-
expect Lookout::Mock::Method::Calls::Error do
|
17
|
-
Lookout::Mock::Method.new(stub, :a).never.tap{ |m| 3.times{ m.call } }.verify
|
18
|
-
end
|
19
|
-
|
20
|
-
expect Lookout::Mock::Method do
|
21
|
-
Lookout::Mock::Method.new(stub, :a).at_most_once.verify
|
22
|
-
end
|
23
|
-
|
24
|
-
expect Lookout::Mock::Method do
|
25
|
-
Lookout::Mock::Method.new(stub, :a).at_most_once.tap{ |m| m.call }.verify
|
26
|
-
end
|
27
|
-
|
28
|
-
expect Lookout::Mock::Method::Calls::Error do
|
29
|
-
Lookout::Mock::Method.new(stub, :a).at_most_once.tap{ |m| 2.times{ m.call } }.verify
|
30
|
-
end
|
31
|
-
|
32
|
-
expect Lookout::Mock::Method::Calls::Error do
|
33
|
-
Lookout::Mock::Method.new(stub, :a).once.verify
|
34
|
-
end
|
35
|
-
|
36
|
-
expect Lookout::Mock::Method do
|
37
|
-
Lookout::Mock::Method.new(stub, :a).once.tap{ |m| m.call }.verify
|
38
|
-
end
|
39
|
-
|
40
|
-
expect Lookout::Mock::Method::Calls::Error do
|
41
|
-
Lookout::Mock::Method.new(stub, :a).once.tap{ |m| 2.times{ m.call } }.verify
|
42
|
-
end
|
43
|
-
|
44
|
-
expect Lookout::Mock::Method::Calls::Error do
|
45
|
-
Lookout::Mock::Method.new(stub, :a).once.tap{ |m| 3.times{ m.call } }.verify
|
46
|
-
end
|
47
|
-
|
48
|
-
expect Lookout::Mock::Method::Calls::Error do
|
49
|
-
Lookout::Mock::Method.new(stub, :a).verify
|
50
|
-
end
|
51
|
-
|
52
|
-
expect Lookout::Mock::Method do
|
53
|
-
Lookout::Mock::Method.new(stub, :a).tap{ |m| m.call }.verify
|
54
|
-
end
|
55
|
-
|
56
|
-
expect Lookout::Mock::Method do
|
57
|
-
Lookout::Mock::Method.new(stub, :a).tap{ |m| 2.times{ m.call } }.verify
|
58
|
-
end
|
59
|
-
|
60
|
-
expect Lookout::Mock::Method::Calls::Error do
|
61
|
-
Lookout::Mock::Method.new(stub, :a).at_least_once.verify
|
62
|
-
end
|
63
|
-
|
64
|
-
expect Lookout::Mock::Method do
|
65
|
-
Lookout::Mock::Method.new(stub, :a).at_least_once.tap{ |m| m.call }.verify
|
66
|
-
end
|
67
|
-
|
68
|
-
expect Lookout::Mock::Method do
|
69
|
-
Lookout::Mock::Method.new(stub, :a).at_least_once.tap{ |m| 2.times{ m.call } }.verify
|
70
|
-
end
|
71
|
-
|
72
|
-
expect Lookout::Mock::Method::Calls::Error do
|
73
|
-
Lookout::Mock::Method.new(stub, :a).twice.verify
|
74
|
-
end
|
75
|
-
|
76
|
-
expect Lookout::Mock::Method::Calls::Error do
|
77
|
-
Lookout::Mock::Method.new(stub, :a).twice.tap{ |m| m.call }.verify
|
78
|
-
end
|
79
|
-
|
80
|
-
expect Lookout::Mock::Method do
|
81
|
-
Lookout::Mock::Method.new(stub, :a).twice.tap{ |m| 2.times{ m.call } }.verify
|
82
|
-
end
|
83
|
-
|
84
|
-
expect Lookout::Mock::Method::Calls::Error do
|
85
|
-
Lookout::Mock::Method.new(stub, :a).twice.tap{ |m| 3.times{ m.call } }.verify
|
86
|
-
end
|
87
|
-
|
88
|
-
expect Lookout::Mock::Method::Calls::Error do
|
89
|
-
Lookout::Mock::Method.new(stub, :a).at_least(2).verify
|
90
|
-
end
|
91
|
-
|
92
|
-
expect Lookout::Mock::Method::Calls::Error do
|
93
|
-
Lookout::Mock::Method.new(stub, :a).at_least(2).tap{ |m| m.call }.verify
|
94
|
-
end
|
95
|
-
|
96
|
-
expect Lookout::Mock::Method do
|
97
|
-
Lookout::Mock::Method.new(stub, :a).at_least(2).tap{ |m| 2.times{ m.call } }.verify
|
98
|
-
end
|
99
|
-
|
100
|
-
expect Lookout::Mock::Method do
|
101
|
-
Lookout::Mock::Method.new(stub, :a).at_least(2).tap{ |m| 3.times{ m.call } }.verify
|
102
|
-
end
|
103
|
-
|
104
|
-
expect Lookout::Mock::Method::Calls::Error do
|
105
|
-
Lookout::Mock::Method.new(stub, :a).exactly(2).verify
|
106
|
-
end
|
107
|
-
|
108
|
-
expect Lookout::Mock::Method::Calls::Error do
|
109
|
-
Lookout::Mock::Method.new(stub, :a).exactly(2).tap{ |m| m.call }.verify
|
110
|
-
end
|
111
|
-
|
112
|
-
expect Lookout::Mock::Method do
|
113
|
-
Lookout::Mock::Method.new(stub, :a).exactly(2).tap{ |m| 2.times{ m.call } }.verify
|
114
|
-
end
|
115
|
-
|
116
|
-
expect Lookout::Mock::Method::Calls::Error do
|
117
|
-
Lookout::Mock::Method.new(stub, :a).exactly(2).tap{ |m| 3.times{ m.call } }.verify
|
118
|
-
end
|
119
|
-
|
120
|
-
expect Lookout::Mock::Method do
|
121
|
-
Lookout::Mock::Method.new(stub, :a).at_most(2).verify
|
122
|
-
end
|
123
|
-
|
124
|
-
expect Lookout::Mock::Method do
|
125
|
-
Lookout::Mock::Method.new(stub, :a).at_most(2).tap{ |m| m.call }.verify
|
126
|
-
end
|
127
|
-
|
128
|
-
expect Lookout::Mock::Method do
|
129
|
-
Lookout::Mock::Method.new(stub, :a).at_most(2).tap{ |m| 2.times{ m.call } }.verify
|
130
|
-
end
|
131
|
-
|
132
|
-
expect Lookout::Mock::Method::Calls::Error do
|
133
|
-
Lookout::Mock::Method.new(stub, :a).at_most(2).tap{ |m| 3.times{ m.call } }.verify
|
134
|
-
end
|
135
|
-
|
136
|
-
expect Lookout::Mock::Method::Arguments::Error do
|
137
|
-
Lookout::Mock::Method.new(stub, :a, 1, 2, 3).call(4, 5, 6)
|
138
|
-
end
|
139
|
-
|
140
|
-
expect Lookout::Mock::Method::Arguments::Error do
|
141
|
-
Lookout::Mock::Method.new(stub, :a, 1, 2, 3).call(4, 5, 6)
|
142
|
-
end
|
143
|
-
end
|
@@ -1,57 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
Expectations do
|
4
|
-
expect true do
|
5
|
-
Lookout::Mock::Method::Arguments.new.verify
|
6
|
-
end
|
7
|
-
|
8
|
-
expect true do
|
9
|
-
Lookout::Mock::Method::Arguments.new.verify(1)
|
10
|
-
end
|
11
|
-
|
12
|
-
expect true do
|
13
|
-
Lookout::Mock::Method::Arguments.new.verify(1, 2)
|
14
|
-
end
|
15
|
-
|
16
|
-
expect Lookout::Mock::Method::Arguments::Error do
|
17
|
-
Lookout::Mock::Method::Arguments.new(Lookout::Mock::Method::Arguments::Anything.new).verify
|
18
|
-
end
|
19
|
-
|
20
|
-
expect true do
|
21
|
-
Lookout::Mock::Method::Arguments.new(Lookout::Mock::Method::Arguments::Anything.new).verify(1)
|
22
|
-
end
|
23
|
-
|
24
|
-
expect Lookout::Mock::Method::Arguments::Error do
|
25
|
-
Lookout::Mock::Method::Arguments.new(Lookout::Mock::Method::Arguments::Anything.new).verify(1, 2)
|
26
|
-
end
|
27
|
-
|
28
|
-
expect Lookout::Mock::Method::Arguments::Error do
|
29
|
-
Lookout::Mock::Method::Arguments.new(Lookout::Mock::Method::Arguments::Anything.new,
|
30
|
-
Lookout::Mock::Method::Arguments::Anything.new).verify(1)
|
31
|
-
end
|
32
|
-
|
33
|
-
expect true do
|
34
|
-
Lookout::Mock::Method::Arguments.new(Lookout::Mock::Method::Arguments::Anything.new,
|
35
|
-
Lookout::Mock::Method::Arguments::Anything.new).verify(1, 2)
|
36
|
-
end
|
37
|
-
|
38
|
-
expect true do
|
39
|
-
Lookout::Mock::Method::Arguments.new(1, 2, 3).verify(1, 2, 3)
|
40
|
-
end
|
41
|
-
|
42
|
-
expect Lookout::Mock::Method::Arguments::Error do
|
43
|
-
Lookout::Mock::Method::Arguments.new(1, 2, 3).verify(4, 5, 6)
|
44
|
-
end
|
45
|
-
|
46
|
-
expect true do
|
47
|
-
Lookout::Mock::Method::Arguments.new(/bcd/).verify('abcde')
|
48
|
-
end
|
49
|
-
|
50
|
-
expect true do
|
51
|
-
Lookout::Mock::Method::Arguments.new(Lookout::Mock::Method::Arguments::None.new).verify
|
52
|
-
end
|
53
|
-
|
54
|
-
expect Lookout::Mock::Method::Arguments::Error do
|
55
|
-
Lookout::Mock::Method::Arguments.new(Lookout::Mock::Method::Arguments::None.new).verify(4)
|
56
|
-
end
|
57
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
Expectations do
|
4
|
-
expect "\tfrom 1
|
5
|
-
\tfrom 2
|
6
|
-
\tfrom 3
|
7
|
-
\tfrom 4
|
8
|
-
\tfrom 5
|
9
|
-
\tfrom 6
|
10
|
-
\tfrom 7
|
11
|
-
\tfrom 8
|
12
|
-
\t ... 6 levels ...
|
13
|
-
\tfrom A
|
14
|
-
\tfrom B
|
15
|
-
\tfrom C
|
16
|
-
\tfrom D
|
17
|
-
\tfrom E" do
|
18
|
-
Lookout::Results::Error::Exception::Backtrace.new(%w[1 2 3 4 5 6 7 8 a b c d e f A B C D E], true, false).to_s
|
19
|
-
end
|
20
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
Expectations do
|
4
|
-
expect false do
|
5
|
-
Lookout::Runners::Trackers::Failure.new(Lookout::Results.new).failed?
|
6
|
-
end
|
7
|
-
|
8
|
-
expect true do
|
9
|
-
results = Lookout::Results.new
|
10
|
-
failed = Lookout::Runners::Trackers::Failure.new(results)
|
11
|
-
results << Lookout::Results::Failures::State.new(nil, 0, nil)
|
12
|
-
failed.failed?
|
13
|
-
end
|
14
|
-
|
15
|
-
expect true do
|
16
|
-
results = Lookout::Results.new
|
17
|
-
failed = Lookout::Runners::Trackers::Failure.new(results)
|
18
|
-
results << Lookout::Results::Failures::State.new(nil, 0, nil)
|
19
|
-
results << Lookout::Results::Fulfilled.new(nil, 0)
|
20
|
-
failed.failed?
|
21
|
-
end
|
22
|
-
|
23
|
-
expect true do
|
24
|
-
results = Lookout::Results.new
|
25
|
-
failed = Lookout::Runners::Trackers::Failure.new(results)
|
26
|
-
results << Lookout::Results::Fulfilled.new(nil, 0)
|
27
|
-
results << Lookout::Results::Failures::State.new(nil, 0, nil)
|
28
|
-
failed.failed?
|
29
|
-
end
|
30
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
Expectations do
|
4
|
-
expect Lookout::Stub::Object do
|
5
|
-
Object.new.tap{ |o| Lookout::Stub::Method.new(o, :a).define }.a
|
6
|
-
end
|
7
|
-
|
8
|
-
expect 1 do
|
9
|
-
Object.new.tap{ |o| Lookout::Stub::Method.new(o, :a){ 1 }.define }.a
|
10
|
-
end
|
11
|
-
|
12
|
-
expect NoMethodError do
|
13
|
-
Object.new.tap{ |o| Lookout::Stub::Method.new(o, :a).define.undefine }.a
|
14
|
-
end
|
15
|
-
|
16
|
-
expect Class.new{ def a() 1 end }.new.to.have.a.equal?(1) do |o|
|
17
|
-
Lookout::Stub::Method.new(o, :a).define.undefine
|
18
|
-
end
|
19
|
-
|
20
|
-
# NOTE: Ruby returs NoMethodError when trying to invoke private methods.
|
21
|
-
expect NoMethodError do
|
22
|
-
o = Object.new
|
23
|
-
class << o; def a() 1 end; private :a; end
|
24
|
-
Lookout::Stub::Method.new(o, :a).define.undefine
|
25
|
-
o.a
|
26
|
-
end
|
27
|
-
|
28
|
-
expect 1 do
|
29
|
-
n = 0
|
30
|
-
Object.new.tap{ |o| Lookout::Stub::Method.new(o, :a).yield(1).define }.a{ |i| n = i }
|
31
|
-
n
|
32
|
-
end
|
33
|
-
|
34
|
-
expect StandardError do
|
35
|
-
Object.new.tap{ |o| Lookout::Stub::Method.new(o, :a){ raise StandardError }.define }.a
|
36
|
-
end
|
37
|
-
|
38
|
-
expect nil do
|
39
|
-
Object.new.tap{ |o| Lookout::Stub::Method.new(o, :a).define }.a{ raise StandardError }
|
40
|
-
nil
|
41
|
-
end
|
42
|
-
|
43
|
-
expect 1 do
|
44
|
-
a = nil
|
45
|
-
Object.new.tap{ |o| Lookout::Stub::Method.new(o, :a).yield(1).define }.a{ |v| a = v }
|
46
|
-
a
|
47
|
-
end
|
48
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
Expectations do
|
4
|
-
expect false do
|
5
|
-
Object.new.nil?
|
6
|
-
end
|
7
|
-
|
8
|
-
expect true do
|
9
|
-
Object.new.tap{ |o|
|
10
|
-
Lookout::Stub::Methods.new.define(o, :nil?){ true }
|
11
|
-
}.nil?
|
12
|
-
end
|
13
|
-
|
14
|
-
expect false do
|
15
|
-
Object.new.tap{ |o|
|
16
|
-
Lookout::Stub::Methods.new.define(o, :nil?){ true }.undefine
|
17
|
-
}.nil?
|
18
|
-
end
|
19
|
-
end
|