Skip to content

Commit

Permalink
update readme and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
alexch committed Aug 28, 2010
1 parent 57cfb53 commit 4493d7d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 4 additions & 3 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ If your assertion is more than a simple predicate, then Wrong will split it into
(y == 11) is false
y is 10

--

age = 24
name = "Gaga"
Expand Down Expand Up @@ -143,7 +144,7 @@ The failure message of the above would be something like "Expected sky.blue? but

And if your assertion code isn't self-explanatory, then that's a hint that you might need to do some refactoring until it is. (Yes, even test code should be clean as a whistle. **Especially** test code.)

## Special Formatting ##
## Formatters ##

Enhancements for error messages sit under wrong/message.

Expand Down Expand Up @@ -204,5 +205,5 @@ If you're in Ruby 1.8, you **really** shouldn't do it! But if you do, you can us

* Github projects: <http://github.com/alexch/wrong>, <http://github.com/sconover/wrong>
* Tracker project: <http://www.pivotaltracker.com/projects/109993>
* [Test::Unit and RSpec to Wrong translation table](https://spreadsheets.google.com/pub?key=0AouPn6oLrimWdE0tZDVOWnFGMzVPZy0tWHZwdnhFYkE&hl=en&output=html). (Ask <alexch@gmail.com> if you want editing privileges.)
* [Wrong slideshow](http://www.slideshare.net/alexchaffee/wrong-5069976)
* [Wrong way translation table (from RSpec and Test::Unit)](https://spreadsheets.google.com/pub?key=0AouPn6oLrimWdE0tZDVOWnFGMzVPZy0tWHZwdnhFYkE&hl=en&output=html). (Ask <alexch@gmail.com> if you want editing privileges.)
* [the Wrong slides I presented at Carbon Five](http://www.slideshare.net/alexchaffee/wrong-5069976)
8 changes: 6 additions & 2 deletions examples.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ def failing
assert { age >= 18 && ["Britney", "Snooki"].include?(name) }
end

failing { assert{'hand'.include?('bird')} }


failing { deny{'abc'.include?('bc')} }


Expand All @@ -42,8 +45,9 @@ def failing

require "wrong/message/array_diff"
failing do
assert { ["venus", "mars", "pluto", "saturn"] ==
["venus", "earth", "pluto", "neptune"] }
fun_planets = ["venus", "mars", "pluto", "saturn"]
smart_planets = ["venus", "earth", "pluto", "neptune"]
assert { fun_planets == smart_planets }
end

failing do
Expand Down

0 comments on commit 4493d7d

Please sign in to comment.