Skip to content

Instantly share code, notes, and snippets.

@jarib
Created August 13, 2009 18:47
Show Gist options
  • Save jarib/167379 to your computer and use it in GitHub Desktop.
Save jarib/167379 to your computer and use it in GitHub Desktop.
require "rubygems"
require "spec/autorun"
%w[foo baar baazs].each do |thing|
describe "my thing" do
it "should be larger than 4 chars" do
thing.size.should > 4
end
end
end
## output:
# FF.
#
# 1)
# 'my thing should be larger than 4 chars' FAILED
# expected: > 4,
# got: 3
# test.spec.rb:9:
# test.spec.rb:5:
#
# 2)
# 'my thing should be larger than 4 chars' FAILED
# expected: > 4,
# got: 4
# test.spec.rb:9:
# test.spec.rb:5:
#
# Finished in 0.003214 seconds
#
# 3 examples, 2 failures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment