2

rspec 2.4.0 と cucumber 0.6.4 を使用しています。私は単純なシナリオを実行しています(この質問のために):

Scenario: Simple Test
When I test something

ステップ定義を使用:

require 'rspec'
require 'rspec/expectations'

When /^I test something$/ do
  result = (1==1)
  result.should be_true
end

このシナリオを実行すると、次の問題が発生します。

 undefined local variable or method `be_true' for #<Object:0x1b3b424> (NameError)

また、依存関係を管理するためにバンドラーを使用しています。

ここで明らかに間違ったことをしていますか?

よろしく、

マーク

4

1 に答える 1

6

きゅうりのドキュメントから:

RSpecの2.xx期待値を使用するには(必要)、以下がfeatures / support/env.rbにあることを確認してください。

require 'rspec/expectations'
World(RSpec::Matchers)

https://github.com/cucumber/cucumber/wiki/RSpec-期待

于 2012-08-01T14:39:41.863 に答える