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
File without changes
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
Expectations do
|
4
|
+
expect Lookout::Actual::Not do Lookout::Actual.new.not end
|
5
|
+
|
6
|
+
expect Lookout::Actual do Lookout::Actual.new.to end
|
7
|
+
|
8
|
+
expect Lookout::Actual do Lookout::Actual.new.to.be end
|
9
|
+
|
10
|
+
expect Lookout::Actual do Lookout::Actual.new.to.have end
|
11
|
+
|
12
|
+
expect Lookout::Actual::Method do Lookout::Actual.new.to.be.empty? end
|
13
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
Expectations do
|
4
|
+
expect 0 do
|
5
|
+
Lookout::Actual::Method::new(:length).call([])
|
6
|
+
end
|
7
|
+
|
8
|
+
expect '#length' do
|
9
|
+
Lookout::Actual::Method::new(:length).to_s
|
10
|
+
end
|
11
|
+
|
12
|
+
expect '#==(0)' do
|
13
|
+
Lookout::Actual::Method::new(:==, 0).to_s
|
14
|
+
end
|
15
|
+
|
16
|
+
expect '#one?{ … }' do
|
17
|
+
Lookout::Actual::Method::new(:one?){ true }.to_s
|
18
|
+
end
|
19
|
+
|
20
|
+
expect '#one?(1){ … }' do
|
21
|
+
Lookout::Actual::Method::new(:one?, 1){ true }.to_s
|
22
|
+
end
|
23
|
+
|
24
|
+
expect '#push(1, 2, 3)' do
|
25
|
+
Lookout::Actual::Method::new(:push, 1, 2, 3).to_s
|
26
|
+
end
|
27
|
+
|
28
|
+
expect Lookout::Expected::Lookout::Actual::Method.new(Lookout::Actual::Method.new(:empty?)) do |o|
|
29
|
+
Lookout::Actual.new.to.be.empty?.to_lookout_expected
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
Expectations do
|
4
|
+
expect Lookout::Actual do
|
5
|
+
Lookout::Actual::Not.new.not
|
6
|
+
end
|
7
|
+
|
8
|
+
expect Lookout::Actual::Not do Lookout::Actual::Not.new.to end
|
9
|
+
|
10
|
+
expect Lookout::Actual::Not do Lookout::Actual::Not.new.to.be end
|
11
|
+
|
12
|
+
expect Lookout::Actual::Not do Lookout::Actual::Not.new.to.have end
|
13
|
+
|
14
|
+
expect Lookout::Actual::Not::Method do Lookout::Actual::Not.new.to.be.empty? end
|
15
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
Expectations do
|
4
|
+
if RUBY_VERSION < '1.9'
|
5
|
+
expect ['__id__', '__send__', 'object_id'] do
|
6
|
+
Lookout::Aphonic.instance_methods.sort
|
7
|
+
end
|
8
|
+
else
|
9
|
+
expect [:__send__, :object_id] do
|
10
|
+
Lookout::Aphonic.instance_methods.sort
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
expect true do
|
15
|
+
class Object; def lookout_test_temporary_method() end end
|
16
|
+
begin
|
17
|
+
Object.method_defined? :lookout_test_temporary_method
|
18
|
+
ensure
|
19
|
+
class Object; remove_method :lookout_test_temporary_method end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
expect false do
|
24
|
+
class Object; def lookout_test_temporary_method() end end
|
25
|
+
begin
|
26
|
+
Lookout::Aphonic.method_defined? :lookout_test_temporary_method
|
27
|
+
ensure
|
28
|
+
class Object; remove_method :lookout_test_temporary_method end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
File without changes
|
File without changes
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
Expectations do
|
4
|
+
expect [Lookout::Diff::Match.new(Lookout::Diff::Slice.new('abxcd', 0..1),
|
5
|
+
Lookout::Diff::Slice.new('abcd', 0..1)),
|
6
|
+
Lookout::Diff::Match.new(Lookout::Diff::Slice.new('abxcd', 3..4),
|
7
|
+
Lookout::Diff::Slice.new('abcd', 2..3)),
|
8
|
+
Lookout::Diff::Match.new(Lookout::Diff::Slice.new('abxcd', 5...5),
|
9
|
+
Lookout::Diff::Slice.new('abcd', 4...4))] do
|
10
|
+
Lookout::Diff::Algorithms::Difflib.new('abxcd', 'abcd').to_a
|
11
|
+
end
|
12
|
+
|
13
|
+
expect [Lookout::Diff::Match.new(Lookout::Diff::Slice.new('acbxcd', 0..0),
|
14
|
+
Lookout::Diff::Slice.new('aybcd', 0..0)),
|
15
|
+
Lookout::Diff::Match.new(Lookout::Diff::Slice.new('acbxcd', 2..2),
|
16
|
+
Lookout::Diff::Slice.new('aybcd', 2..2)),
|
17
|
+
Lookout::Diff::Match.new(Lookout::Diff::Slice.new('acbxcd', 4..5),
|
18
|
+
Lookout::Diff::Slice.new('aybcd', 3..4)),
|
19
|
+
Lookout::Diff::Match.new(Lookout::Diff::Slice.new('acbxcd', 6...6),
|
20
|
+
Lookout::Diff::Slice.new('aybcd', 5...5))] do
|
21
|
+
Lookout::Diff::Algorithms::Difflib.new('acbxcd', 'aybcd').to_a
|
22
|
+
end
|
23
|
+
|
24
|
+
expect [Lookout::Diff::Match.new(Lookout::Diff::Slice.new('qabxcd', 1..2),
|
25
|
+
Lookout::Diff::Slice.new('abycdf', 0..1)),
|
26
|
+
Lookout::Diff::Match.new(Lookout::Diff::Slice.new('qabxcd', 4..5),
|
27
|
+
Lookout::Diff::Slice.new('abycdf', 3..4)),
|
28
|
+
Lookout::Diff::Match.new(Lookout::Diff::Slice.new('qabxcd', 6...6),
|
29
|
+
Lookout::Diff::Slice.new('abycdf', 6...6))] do
|
30
|
+
Lookout::Diff::Algorithms::Difflib.new('qabxcd', 'abycdf').to_a
|
31
|
+
end
|
32
|
+
|
33
|
+
expect [Lookout::Diff::Match.new(Lookout::Diff::Slice.new('abxcd', 0..1),
|
34
|
+
Lookout::Diff::Slice.new('abcd', 0..1)),
|
35
|
+
Lookout::Diff::Match.new(Lookout::Diff::Slice.new('abxcd', 3..4),
|
36
|
+
Lookout::Diff::Slice.new('abcd', 2..3)),
|
37
|
+
Lookout::Diff::Match.new(Lookout::Diff::Slice.new('abxcd', 5...5),
|
38
|
+
Lookout::Diff::Slice.new('abcd', 4...4)),] do
|
39
|
+
Lookout::Diff::Algorithms::Difflib.new('abxcd', 'abcd').to_a
|
40
|
+
end
|
41
|
+
|
42
|
+
# 0, 0, 8
|
43
|
+
# 8, 17, 21
|
44
|
+
# 29, 38, 0
|
45
|
+
expect [Lookout::Diff::Match.new(Lookout::Diff::Slice.new('private Thread currentThread;', 0..7),
|
46
|
+
Lookout::Diff::Slice.new('private volatile Thread currentThread;', 0..7)),
|
47
|
+
Lookout::Diff::Match.new(Lookout::Diff::Slice.new('private Thread currentThread;', 8..28),
|
48
|
+
Lookout::Diff::Slice.new('private volatile Thread currentThread;', 17..37)),
|
49
|
+
Lookout::Diff::Match.new(Lookout::Diff::Slice.new('private Thread currentThread;', 29...29),
|
50
|
+
Lookout::Diff::Slice.new('private volatile Thread currentThread;', 38...38))] do
|
51
|
+
Lookout::Diff::Algorithms::Difflib.new('private Thread currentThread;',
|
52
|
+
'private volatile Thread currentThread;'){ |c|
|
53
|
+
c == ' '[0]
|
54
|
+
}.to_a
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
Expectations do
|
4
|
+
expect Lookout::Diff::Match.new(Lookout::Diff::Slice.new('abc', 0...0),
|
5
|
+
Lookout::Diff::Slice.new('xyz', 0...0)) do
|
6
|
+
Lookout::Diff::Algorithms::Difflib::Position.origin('abc', 'xyz').match
|
7
|
+
end
|
8
|
+
|
9
|
+
expect Lookout::Diff::Match.new(Lookout::Diff::Slice.new('abc'),
|
10
|
+
Lookout::Diff::Slice.new('abc')) do
|
11
|
+
Lookout::Diff::Algorithms::Difflib::Position.origin('abc', 'abc').match
|
12
|
+
end
|
13
|
+
|
14
|
+
expect Lookout::Diff::Match.new(Lookout::Diff::Slice.new('Xabc', 1..3),
|
15
|
+
Lookout::Diff::Slice.new('abc')) do
|
16
|
+
Lookout::Diff::Algorithms::Difflib::Position.origin('Xabc', 'abc').match
|
17
|
+
end
|
18
|
+
|
19
|
+
expect Lookout::Diff::Match.new(Lookout::Diff::Slice.new('abcX', 0..2),
|
20
|
+
Lookout::Diff::Slice.new('abc')) do
|
21
|
+
Lookout::Diff::Algorithms::Difflib::Position.origin('abcX', 'abc').match
|
22
|
+
end
|
23
|
+
|
24
|
+
expect Lookout::Diff::Match.new(Lookout::Diff::Slice.new('abc'),
|
25
|
+
Lookout::Diff::Slice.new('Xabc', 1..3)) do
|
26
|
+
Lookout::Diff::Algorithms::Difflib::Position.origin('abc', 'Xabc').match
|
27
|
+
end
|
28
|
+
|
29
|
+
expect Lookout::Diff::Match.new(Lookout::Diff::Slice.new('abc'),
|
30
|
+
Lookout::Diff::Slice.new('abcX', 0..2)) do
|
31
|
+
Lookout::Diff::Algorithms::Difflib::Position.origin('abc', 'abcX').match
|
32
|
+
end
|
33
|
+
|
34
|
+
expect Lookout::Diff::Match.new(Lookout::Diff::Slice.new('ab', 0..1),
|
35
|
+
Lookout::Diff::Slice.new('abXabc', 0..1)) do
|
36
|
+
Lookout::Diff::Algorithms::Difflib::Position.origin('ab', 'abXabc').match
|
37
|
+
end
|
38
|
+
|
39
|
+
expect Lookout::Diff::Match.new(Lookout::Diff::Slice.new('abc'),
|
40
|
+
Lookout::Diff::Slice.new('abXabc', 3..5)) do
|
41
|
+
Lookout::Diff::Algorithms::Difflib::Position.origin('abc', 'abXabc').match
|
42
|
+
end
|
43
|
+
|
44
|
+
expect Lookout::Diff::Match.new(Lookout::Diff::Slice.new(' abc', 1..3),
|
45
|
+
Lookout::Diff::Slice.new('abc abc', 0..2)) do
|
46
|
+
Lookout::Diff::Algorithms::Difflib::Position.origin(' abc', 'abc abc'){ |c| c == ' '[0] }.match
|
47
|
+
end
|
48
|
+
|
49
|
+
# TODO: Need more tests for is_junk.
|
50
|
+
|
51
|
+
expect false do
|
52
|
+
Lookout::Diff::Algorithms::Difflib::Position.origin('abc', 'abc').
|
53
|
+
begin_before? Lookout::Diff::Match.new(Lookout::Diff::Slice.new('abc', 0..0),
|
54
|
+
Lookout::Diff::Slice.new('abc', 0..0))
|
55
|
+
end
|
56
|
+
|
57
|
+
expect true do
|
58
|
+
Lookout::Diff::Algorithms::Difflib::Position.origin('abc', 'abc').
|
59
|
+
begin_before? Lookout::Diff::Match.new(Lookout::Diff::Slice.new('abc', 1..1),
|
60
|
+
Lookout::Diff::Slice.new('abc', 1..1))
|
61
|
+
end
|
62
|
+
|
63
|
+
expect false do
|
64
|
+
Lookout::Diff::Algorithms::Difflib::Position.origin('abc', 'abc').
|
65
|
+
end_after? Lookout::Diff::Match.new(Lookout::Diff::Slice.new('abc', 3..3),
|
66
|
+
Lookout::Diff::Slice.new('abc', 3..3))
|
67
|
+
end
|
68
|
+
|
69
|
+
expect true do
|
70
|
+
Lookout::Diff::Algorithms::Difflib::Position.origin('abc', 'abc').
|
71
|
+
end_after? Lookout::Diff::Match.new(Lookout::Diff::Slice.new('abc', 1..1),
|
72
|
+
Lookout::Diff::Slice.new('abc', 1..1))
|
73
|
+
end
|
74
|
+
|
75
|
+
expect Lookout::Diff::Algorithms::Difflib::Position.
|
76
|
+
new(Lookout::Diff::Slice.new('dabcX', 4..4),
|
77
|
+
Lookout::Diff::Algorithms::Difflib::Position::New.new('ddabcY', 5..5),
|
78
|
+
{}) do
|
79
|
+
Lookout::Diff::Algorithms::Difflib::Position.origin('dabcX', 'ddabcY').
|
80
|
+
begin_after(Lookout::Diff::Match.new(Lookout::Diff::Slice.new('dabcX', 0..3),
|
81
|
+
Lookout::Diff::Slice.new('ddabcY', 1..4)))
|
82
|
+
end
|
83
|
+
|
84
|
+
expect Lookout::Diff::Algorithms::Difflib::Position.
|
85
|
+
new(Lookout::Diff::Slice.new('dabcX', 0...0),
|
86
|
+
Lookout::Diff::Algorithms::Difflib::Position::New.new('ddabcY', 0..0),
|
87
|
+
{}) do
|
88
|
+
Lookout::Diff::Algorithms::Difflib::Position.origin('dabcX', 'ddabcY').
|
89
|
+
end_before(Lookout::Diff::Match.new(Lookout::Diff::Slice.new('dabcX', 0..3),
|
90
|
+
Lookout::Diff::Slice.new('ddabcY', 1..4)))
|
91
|
+
end
|
92
|
+
end
|
@@ -3,8 +3,7 @@
|
|
3
3
|
Expectations do
|
4
4
|
expect [0, 2] do
|
5
5
|
result = []
|
6
|
-
Lookout::Diff::Algorithms::Difflib::Position::
|
7
|
-
new(%w[a b a]).each_index('a') do |index|
|
6
|
+
Lookout::Diff::Algorithms::Difflib::Position::New.new(%w[a b a]).each_index('a') do |index|
|
8
7
|
result << index
|
9
8
|
end
|
10
9
|
result
|
File without changes
|
File without changes
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
Expectations do
|
4
|
+
expect '' do
|
5
|
+
Lookout::Diff::Formats::Set.
|
6
|
+
new(Lookout::Diff::Operations.
|
7
|
+
new(Lookout::Diff::Algorithms::Difflib.
|
8
|
+
new(['a => 1', 'b => 2', 'c => 3'],
|
9
|
+
['a => 1', 'b => 2', 'c => 3']))).to_a.join("\n")
|
10
|
+
end
|
11
|
+
|
12
|
+
expect <<EOD.chomp do
|
13
|
+
-a => 1
|
14
|
+
-b => 2
|
15
|
+
-c => 3
|
16
|
+
+a => 0
|
17
|
+
+b => 1
|
18
|
+
+c => 2
|
19
|
+
EOD
|
20
|
+
Lookout::Diff::Formats::Set.
|
21
|
+
new(Lookout::Diff::Operations.
|
22
|
+
new(Lookout::Diff::Algorithms::Difflib.
|
23
|
+
new(['a => 1', 'b => 2', 'c => 3', 'd => 4'],
|
24
|
+
['a => 0', 'b => 1', 'c => 2', 'd => 4']))).to_a.join("\n")
|
25
|
+
end
|
26
|
+
end
|
File without changes
|
File without changes
|
@@ -0,0 +1,102 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
Expectations do
|
4
|
+
expect [] do
|
5
|
+
Lookout::Diff::Groups.
|
6
|
+
new(Lookout::Diff::Operations.
|
7
|
+
new(Lookout::Diff::Algorithms::Difflib.new('', ''))).to_a
|
8
|
+
end
|
9
|
+
|
10
|
+
expect [Lookout::Diff::Group.new(Lookout::Diff::Operations::Copy.new(Lookout::Diff::Slice.new('abc', 0..2),
|
11
|
+
Lookout::Diff::Slice.new('abc', 0..2)))] do
|
12
|
+
Lookout::Diff::Groups.
|
13
|
+
new(Lookout::Diff::Operations.
|
14
|
+
new(Lookout::Diff::Algorithms::Difflib.new('abc', 'abc'))).to_a
|
15
|
+
end
|
16
|
+
|
17
|
+
expect [Lookout::Diff::Group.new(Lookout::Diff::Operations::Copy.new(Lookout::Diff::Slice.new('abcdefg', 4..6),
|
18
|
+
Lookout::Diff::Slice.new('abcdefg', 4..6)))] do
|
19
|
+
Lookout::Diff::Groups.
|
20
|
+
new(Lookout::Diff::Operations.
|
21
|
+
new(Lookout::Diff::Algorithms::Difflib.
|
22
|
+
new('abcdefg',
|
23
|
+
'abcdefg'))).to_a
|
24
|
+
end
|
25
|
+
|
26
|
+
expect [Lookout::Diff::Group.new(Lookout::Diff::Operations::Replace.new(Lookout::Diff::Slice.new('Abcdefg', 0..0),
|
27
|
+
Lookout::Diff::Slice.new('abcdefg', 0..0)),
|
28
|
+
Lookout::Diff::Operations::Copy.new(Lookout::Diff::Slice.new('Abcdefg', 1..3),
|
29
|
+
Lookout::Diff::Slice.new('abcdefg', 1..3)))] do
|
30
|
+
Lookout::Diff::Groups.
|
31
|
+
new(Lookout::Diff::Operations.
|
32
|
+
new(Lookout::Diff::Algorithms::Difflib.
|
33
|
+
new('Abcdefg',
|
34
|
+
'abcdefg'))).to_a
|
35
|
+
end
|
36
|
+
|
37
|
+
expect [Lookout::Diff::Group.new(Lookout::Diff::Operations::Replace.new(Lookout::Diff::Slice.new('Abcdefgh', 0..0),
|
38
|
+
Lookout::Diff::Slice.new('abcdefgh', 0..0)),
|
39
|
+
Lookout::Diff::Operations::Copy.new(Lookout::Diff::Slice.new('Abcdefgh', 1..3),
|
40
|
+
Lookout::Diff::Slice.new('abcdefgh', 1..3)))] do
|
41
|
+
Lookout::Diff::Groups.
|
42
|
+
new(Lookout::Diff::Operations.
|
43
|
+
new(Lookout::Diff::Algorithms::Difflib.
|
44
|
+
new('Abcdefgh',
|
45
|
+
'abcdefgh'))).to_a
|
46
|
+
end
|
47
|
+
|
48
|
+
expect [Lookout::Diff::Group.new(Lookout::Diff::Operations::Copy.new(Lookout::Diff::Slice.new('abcdefgHijklmno', 4..6),
|
49
|
+
Lookout::Diff::Slice.new('abcdefghijklmno', 4..6)),
|
50
|
+
Lookout::Diff::Operations::Replace.new(Lookout::Diff::Slice.new('abcdefgHijklmno', 7..7),
|
51
|
+
Lookout::Diff::Slice.new('abcdefghijklmno', 7..7)),
|
52
|
+
Lookout::Diff::Operations::Copy.new(Lookout::Diff::Slice.new('abcdefgHijklmno', 8..10),
|
53
|
+
Lookout::Diff::Slice.new('abcdefghijklmno', 8..10)))] do
|
54
|
+
Lookout::Diff::Groups.
|
55
|
+
new(Lookout::Diff::Operations.
|
56
|
+
new(Lookout::Diff::Algorithms::Difflib.
|
57
|
+
new('abcdefgHijklmno',
|
58
|
+
'abcdefghijklmno'))).to_a
|
59
|
+
end
|
60
|
+
|
61
|
+
expect [Lookout::Diff::Group.new(Lookout::Diff::Operations::Copy.new(Lookout::Diff::Slice.new('123456789abcdefghijk', 0..0),
|
62
|
+
Lookout::Diff::Slice.new('1i3456789abXdhYjk', 0..0)),
|
63
|
+
Lookout::Diff::Operations::Replace.new(Lookout::Diff::Slice.new('123456789abcdefghijk', 1..1),
|
64
|
+
Lookout::Diff::Slice.new('1i3456789abXdhYjk', 1..1)),
|
65
|
+
Lookout::Diff::Operations::Copy.new(Lookout::Diff::Slice.new('123456789abcdefghijk', 2..4),
|
66
|
+
Lookout::Diff::Slice.new('1i3456789abXdhYjk', 2..4))),
|
67
|
+
Lookout::Diff::Group.new(Lookout::Diff::Operations::Copy.new(Lookout::Diff::Slice.new('123456789abcdefghijk', 8..10),
|
68
|
+
Lookout::Diff::Slice.new('1i3456789abXdhYjk', 8..10)),
|
69
|
+
Lookout::Diff::Operations::Replace.new(Lookout::Diff::Slice.new('123456789abcdefghijk', 11..11),
|
70
|
+
Lookout::Diff::Slice.new('1i3456789abXdhYjk', 11..11)),
|
71
|
+
Lookout::Diff::Operations::Copy.new(Lookout::Diff::Slice.new('123456789abcdefghijk', 12..12),
|
72
|
+
Lookout::Diff::Slice.new('1i3456789abXdhYjk', 12..12)),
|
73
|
+
Lookout::Diff::Operations::Delete.new(Lookout::Diff::Slice.new('123456789abcdefghijk', 13..15),
|
74
|
+
Lookout::Diff::Slice.new('1i3456789abXdhYjk', 13...13)),
|
75
|
+
Lookout::Diff::Operations::Copy.new(Lookout::Diff::Slice.new('123456789abcdefghijk', 16..16),
|
76
|
+
Lookout::Diff::Slice.new('1i3456789abXdhYjk', 13..13)),
|
77
|
+
Lookout::Diff::Operations::Replace.new(Lookout::Diff::Slice.new('123456789abcdefghijk', 17..17),
|
78
|
+
Lookout::Diff::Slice.new('1i3456789abXdhYjk', 14..14)),
|
79
|
+
Lookout::Diff::Operations::Copy.new(Lookout::Diff::Slice.new('123456789abcdefghijk', 18..19),
|
80
|
+
Lookout::Diff::Slice.new('1i3456789abXdhYjk', 15..16)))] do
|
81
|
+
Lookout::Diff::Groups.
|
82
|
+
new(Lookout::Diff::Operations.
|
83
|
+
new(Lookout::Diff::Algorithms::Difflib.
|
84
|
+
new('123456789abcdefghijk',
|
85
|
+
'1i3456789abXdhYjk'))).to_a
|
86
|
+
end
|
87
|
+
|
88
|
+
expect [Lookout::Diff::Group.new(Lookout::Diff::Operations::Insert.new(Lookout::Diff::Slice.new(%w[one two three four], 0...0),
|
89
|
+
Lookout::Diff::Slice.new(%w[zero one tree four], 0..0)),
|
90
|
+
Lookout::Diff::Operations::Copy.new(Lookout::Diff::Slice.new(%w[one two three four], 0..0),
|
91
|
+
Lookout::Diff::Slice.new(%w[zero one tree four], 1..1)),
|
92
|
+
Lookout::Diff::Operations::Replace.new(Lookout::Diff::Slice.new(%w[one two three four], 1..2),
|
93
|
+
Lookout::Diff::Slice.new(%w[zero one tree four], 2..2)),
|
94
|
+
Lookout::Diff::Operations::Copy.new(Lookout::Diff::Slice.new(%w[one two three four], 3..3),
|
95
|
+
Lookout::Diff::Slice.new(%w[zero one tree four], 3..3)))] do
|
96
|
+
Lookout::Diff::Groups.
|
97
|
+
new(Lookout::Diff::Operations.
|
98
|
+
new(Lookout::Diff::Algorithms::Difflib.
|
99
|
+
new(%w[one two three four],
|
100
|
+
%w[zero one tree four]))).to_a
|
101
|
+
end
|
102
|
+
end
|
File without changes
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
Expectations do
|
4
|
+
expect true do
|
5
|
+
Lookout::Diff::Operation.new(Lookout::Diff::Slice.new('', 0...0),
|
6
|
+
Lookout::Diff::Slice.new('', 0...0)) ==
|
7
|
+
Lookout::Diff::Operation.new(Lookout::Diff::Slice.new('', 0...0),
|
8
|
+
Lookout::Diff::Slice.new('', 0...0))
|
9
|
+
end
|
10
|
+
|
11
|
+
expect false do
|
12
|
+
Lookout::Diff::Operation.new(Lookout::Diff::Slice.new('', 0...0),
|
13
|
+
Lookout::Diff::Slice.new('', 0...0)) ==
|
14
|
+
Lookout::Diff::Operation.new(Lookout::Diff::Slice.new('', 0...1),
|
15
|
+
Lookout::Diff::Slice.new('', 0...3))
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
Expectations do
|
4
|
+
expect [] do
|
5
|
+
Lookout::Diff::Operations.new(Lookout::Diff::Algorithms::Difflib.new('',
|
6
|
+
'')).to_a
|
7
|
+
end
|
8
|
+
|
9
|
+
expect [Lookout::Diff::Operations::Delete.new(Lookout::Diff::Slice.new('qabxcd', 0..0),
|
10
|
+
Lookout::Diff::Slice.new('abycdf', 0...0)),
|
11
|
+
Lookout::Diff::Operations::Copy.new(Lookout::Diff::Slice.new('qabxcd', 1..2),
|
12
|
+
Lookout::Diff::Slice.new('abycdf', 0..1)),
|
13
|
+
Lookout::Diff::Operations::Replace.new(Lookout::Diff::Slice.new('qabxcd', 3..3),
|
14
|
+
Lookout::Diff::Slice.new('abycdf', 2..2)),
|
15
|
+
Lookout::Diff::Operations::Copy.new(Lookout::Diff::Slice.new('qabxcd', 4..5),
|
16
|
+
Lookout::Diff::Slice.new('abycdf', 3..4)),
|
17
|
+
Lookout::Diff::Operations::Insert.new(Lookout::Diff::Slice.new('qabxcd', 6...6),
|
18
|
+
Lookout::Diff::Slice.new('abycdf', 5..5))] do
|
19
|
+
Lookout::Diff::Operations.new(Lookout::Diff::Algorithms::Difflib.new('qabxcd',
|
20
|
+
'abycdf')).to_a
|
21
|
+
end
|
22
|
+
end
|