T
timr
I came across the following code (see below). As President Clinton
famously said, "It depends on what the definition of 'it' is." I am
hoping someone can explain how 'it' is being used. I have come across
this 'it...string...do' construct before, but I didn't understand it
then either.
describe IowaRubyBrigade do
before do
@irb = Array.new
end
it "should be a user group" do
@irb.should be_a_kind_of(UserGroup)
end
it "should meet monthly" do
@irb.meeting_time.should ==
'second Thursday of every month'
end
it "should be fun" do
@irb.should be_fun
end
end
When you ri it, you get:
----------------------------------
Spec::Example::ExampleGroupMethods#it
it(description=nil, &implementation)
------------------------------------------------------------------------
Creates an instance of Spec::Example::Example and adds it to a
collection of examples of the current example group.
(also known as specify)
But the documentation on Spec is difficult to find. Please educate me.
Thanks,
Tim
famously said, "It depends on what the definition of 'it' is." I am
hoping someone can explain how 'it' is being used. I have come across
this 'it...string...do' construct before, but I didn't understand it
then either.
describe IowaRubyBrigade do
before do
@irb = Array.new
end
it "should be a user group" do
@irb.should be_a_kind_of(UserGroup)
end
it "should meet monthly" do
@irb.meeting_time.should ==
'second Thursday of every month'
end
it "should be fun" do
@irb.should be_fun
end
end
When you ri it, you get:
----------------------------------
Spec::Example::ExampleGroupMethods#it
it(description=nil, &implementation)
------------------------------------------------------------------------
Creates an instance of Spec::Example::Example and adds it to a
collection of examples of the current example group.
(also known as specify)
But the documentation on Spec is difficult to find. Please educate me.
Thanks,
Tim