Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
新しい expect() 構文に切り替えます。
取得
syntax error, unexpected tASSOC, expecting '}' (SyntaxError)
このため:
expect(subject.crumbs.last.data).to eq {:foo => :bar }
この構文エラーを修正するにはどうすればよいですか?
別の修正方法:
expect(subject.crumbs.last.data).to eq(foo: :bar)
(ルビー 1.9+)
このコードは機能します (eq 値の周りに括弧を追加します):
expect(subject.crumbs.last.data).to eq({:foo => :bar })