【发布时间】:2011-09-10 19:13:33
【问题描述】:
现在我的 rpsec 是这样的:
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
有没有一种方法可以在每个描述块之前定义一个?像这样的:
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
before(:each) do
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
end
it "should xxx" do
end
it "should xxx" do
end
end
end
谢谢
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-3 rspec rspec2