如何在此代码中从should更改expect为:-it
context 'class_name' do
before do
Fabricator(:some_company, :class_name => Company) do
name 'Hashrocket'
end
end
after { Fabrication.clear_definitions }
its(:name) { should == 'Hashrocket' }
it { should be_kind_of(Company) }
end
我可以看到its可能是:
expect(name.to eq 'Hashrocket')
it { should be_kind_of(Company) }但是给定隐含的主题应该变成什么。
可不可能是
expect(it).to be_kind_of(Company)
?
我还没有从 github 建立项目(它很大)。