One of RSpec‘s many neat features is the ability to insert placeholder specs. These allow you to list a whole bunch of expected behaviour up front, without having to implement either the specs or the code, and without creating a huge swath of failing specs. All you need to do is omit the body of the specify or it block. Here’s a trivial example:
[ruby]
describe “The string ‘foo’” do
before do
@foo = ‘foo’
end
it “should be three characters long” do
@foo.size.should == 3
end
it “should be capitalised to ‘Foo’”
end
[/ruby]
$ spec -f s foo_spec.rb The string 'foo' - should be three characters long - should be capitalised to 'Foo' (NOT IMPLEMENTED) Finished in 0.011201 seconds 2 examples, 0 failures, 1 not implemented
How To Update Facebook, Twitter, and Kopete’s Status All At Once…
…
Ben Kudria
16 Aug 07 at 8:01 pm
looks like you can also do
it “should do something” do
pending “an announcement”
end
or
it “should do something” do
pending “an announcement” do
end
end
roger
15 Dec 09 at 5:06 pm