Right now my rpsec goes like this:
describe Ability do
before(:each) do
end
describe 'xxx' do
it "should xxx" do
end
it "should xxx" do
end
end
describe 'xxx' do
it "should xxx" do
end
it "should xxx" do
end
end
describe 'xxx' do
it "should xxx" do
end
it "should xxx" do
end
end
describe 'xxx' do
it "should xxx" do
end
it "should xxx" do
end
end
end
Is there a way I can define a before each for just one of the describe blocks? Something like this:
describe Ability do
before(:each) do
end
describe 'xxx' do
it "should xxx" do
end
it "should xxx" do
end
end
describe 'xxx' do
it "should xxx" do
end
it "should xxx" do
end
end
describe 'xxx' do
it "should xxx" do
end
it "should xxx" do
end
end
describe 'xxx' 开发者_JAVA百科do
before(:each) do
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
end
it "should xxx" do
end
it "should xxx" do
end
end
end
Thanks
The solution you gave should work. Have you tried it ?
精彩评论