私のコードはbefore :each
ブロックを使用しています:
before :each do
@unsorted=[1,5,6,7,4,5,8,4,2,5,2]
end
it "contains an unsorted an array" do
test_array = BubbleSort.new(@unsorted)
expect(test_array.contents).to eq [1,5,6,7,4,5,8,4,2,5,2]
end
before :each
コードをインラインにしたいのですが、
before :each {@unsorted=[1,5,6,7,4,5,8,4,2,5,2]}
与えます:
syntax error, unexpected '{', expecting keyword_
end (SyntaxError)
どうすればこれを修正できますか?