8

I was trying to use the "should be" function along with the logical "OR" operator as follows (for example) :

 def String(x :Integer) :Integer ={
       /*----------------
      -----------------*/
      return value;
 }

 String.value.size should be (8) || String.value.size should be (0) /*that is anything other than the value 8 or 0 should cause a false and the program should start execution */

But I get an error saying "value || is not a member of org.scalatest.matchers.Matcher[Any]"

Can somebody help me here. Thank you in advance..

Keith Pinson
  • 1,725
  • 1
  • 14
  • 17
Goldengirl
  • 957
  • 4
  • 10
  • 30

1 Answers1

18

From the error message, it looks like String.value.size should be (8) returns an instance of org.scalatest.matchers.Matcher which does not have a member ||. According to this you should use or for disjunction e.g.

String.value.size should (be (8) or be (0))
Lee
  • 142,018
  • 20
  • 234
  • 287