rspec_gandalf
Because some objects shall not pass.
Installation
Add this line to your application's Gemfile:
gem 'rspec_gandalf'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install rspec_gandalf
Usage
- Create a file named "gandalf_test.rb"
- Put this:
# coding: utf-8
require 'rspec_gandalf'
class Balrog;end;
class Men;end;
class Hobbit;end;
class TrollRog < Balrog;end;
class PretaGil < Balrog;end;
describe Men do
it { shall pass }
end
describe Balrog do
it { shall pass }
end
describe TrollRog do
it { shall pass }
end
describe PretaGil do
it { shall_not pass }
end
-
Test it
$ rspec gandalf_test.rb
-
See the result
-
Balrog Failure/Error: it { shall pass } ATTENTION: Balrog is a flame of Udun and SHALL NOT PASS.
-
TrollRog Failure/Error: it { shall pass } RUN YOU FOOL. Your disguise doesn't trick me. ATTENTION: TrollRog is a flame of Udun and SHALL NOT PASS 4 examples, 2 failures Failed examples:
rspec ./test.rb:19 # Balrog rspec ./test.rb:23 # TrollRog
-