flipping - highlight differences in complex Maven test values
"This flipping circuit board, Jen. Some chump has run the data lines right through the power supply. Amateur hour! I've got tears in my eyes!"
--Maurice Moss, IT Crowd
EXAMPLES
mvn test
produces two failures. Differences in simple types are automatically highlighted by JUnit, but more complex types, such as collections, require flipping diff tools to locate.
$ cd example/
$ flipping
flipping
can be run over alternate Maven test commands:
$ flipping "mvn test -Dtest=BustedTest#simpleTest" | less
diff --git a/var/folders/53/300vy1ys7tv8h8fr_z3tm8gr0000gn/T/expected20140108-18011-1i1kjvl b/var/folders/53/300vy1ys7tv8h8fr_z3tm8gr0000gn/T/actual20140108-18011-18l7tsz
index 4e8ea00..a008cb6 100644
--- a/var/folders/53/300vy1ys7tv8h8fr_z3tm8gr0000gn/T/expected20140108-18011-1i1kjvl
+++ b/var/folders/53/300vy1ys7tv8h8fr_z3tm8gr0000gn/T/actual20140108-18011-18l7tsz
@@ -1 +1 @@
-Actual: 1
+Expected: 2
Run flipping -h
to show more options, or flipping -v
to show the version number.
HOMEPAGE
https://github.com/mcandre/flipping
FEATURES
- Diff values, not just lines (good for long and complex objects)
- Color-coded differences (eyeball the changes faster)
- Disables colors for tty's (compatible with piping to other programs)
REQUIREMENTS
Optional
INSTALL
$ gem install flipping
DEVELOPMENT
Checkout a copy of the code, and get the developer dependencies:
$ git clone https://github.com/mcandre/flipping.git
$ cd flipping
$ bundle
Testing
Ensure the example script works as expected:
$ bundle
$ cucumber
Feature: Run example tests
Scenario: Running example tests # features/run_example_tests.feature:3
Given the program has finished # features/step_definitions/steps.rb:1
Then the output is correct for each test # features/step_definitions/steps.rb:5
1 scenario (1 passed)
2 steps (2 passed)
0m3.275s
Linting
Keep the code looking good with the linter tools:
$ rake lint
Git Hooks
See hooks/
.