test
次のRSpecを使ったテストコードはどちらが良いだろうか? Type 1 describe Foo, "hoge" do before do @arg = gen_something() end it "bar" do Foo.new(@arg).should be_an_instance_of(Foo) end # ...略,以降のコードに@argは現れない. end Type 2 descri…
次のRSpecを使ったテストコードはどちらが良いだろうか? Type 1 describe Foo, "hoge" do before do @arg = gen_something() end it "bar" do Foo.new(@arg).should be_an_instance_of(Foo) end # ...略,以降のコードに@argは現れない. end Type 2 descri…