Search code examples
cucumberwatirrubymine

Couldn't understand RSpec expectation error


I am getting this ExpectationNotMetError in my cucumber/watir test,

How to tell the difference?

RSpec::Expectations::ExpectationNotMetError:

expected: "Limits as usual \u0393\u00C7\u00F6 Limits in perspective /\u256B\u00C6\u256B\u00E6\u256B\u00F2\u256B\u00A3\u256B\u00F2\u256B\u00AC\u256B\u00D6\u256B\u00F6 \u256B\u2310\u256B\u00A3 \u256B\u00C9\u256B\u00D6\u256B\u00A3\u256B\u00D6\u256B\u00F6 \u256B\u00BA\u256B\u00F1\u256B\u00D6\u256B\u00FF\u256B\u00F2\u256B\u00A3\u256B\u00D6\u256B\u00E1\u256B\u00F6 \u0393\u00C7\u00F6 \u256B\u20A7\u256B\u00E6\u256B\u00FF \u256B\u20A7\u256B\u00E6\u256B\u00AC\u256B\u00D6 \u256B\u00F6\u256B\u00BA\u256B\u00E6\u256B\u00BF\u256B\u00F2\u256B\u00AC"

got: "Limits as usual \u2014 Limits in perspective /\u05D2\u05D1\u05D5\u05DC\u05D5\u05EA\u05D9\u05D4 \u05E9\u05DC \u05D0\u05D9\u05DC\u05D9\u05D4 \u05E7\u05E4\u05D9\u05D8\u05D5\u05DC\u05D9\u05E0\u05D4 \u2014 \u05DE\u05D1\u05D8 \u05DE\u05D1\u05EA\u05D9 \u05D4\u05E7\u05D1\u05E8\u05D5\u05EA"


Solution

  • The string you are testing contains "\u 2014" but your test expects the string not to contain that. As a result, the test is failing on the expectation.

    To simplify:

    expected: "............" got "......2014......"