[rspec-users] diff output "back to front"

Wincent Colaiuta win at wincent.com
Sat Feb 9 08:17:48 EST 2008


Is it just me, or is the output of "spec --diff" "back to front"?

In other words given expected result:

foo 1
foo 2
foo 3

And actual result:

foo 1
foo 2
bar x
foo 3

This is what "spec --diff u the_spec.rb" shows me:

2)
'Thing should blah' FAILED
expected: "foo 1\nfoo 2\nfoo 3\n",
      got: "foo 1\nfoo 2\nbar x\nfoo 3\n" (using ==)
Diff:
@@ -1,5 +1,4 @@
  foo 1
  foo 2
-bar x
  foo 3
./spec/the_spec.rb:208:

In other words it's showing me "how is the expected result different  
from the actual?", but I think it would be more intuitive for it to  
show the opposite ("how is the actual result different from the  
expected?"); to me this latter question is much more interesting and  
is the answer I am interested in when I ask "what's the difference  
between the actual and the expected?". The output:

2)
'Thing should blah' FAILED
expected: "foo 1\nfoo 2\nfoo 3\n",
      got: "foo 1\nfoo 2\nbar x\nfoo 3\n" (using ==)
Diff:
@@ -1,5 +1,4 @@
  foo 1
  foo 2
+bar x
  foo 3
./spec/the_spec.rb:208:

I understand that this kind of thing might be subjective, so wanted to  
know what other people think.

I also have this spook sense of deja vu while writing this, so please  
forgive me if this has come up before.

Cheers,
Wincent



More information about the rspec-users mailing list