Skip to content
Browse files

more examples

  • Loading branch information...
1 parent 8d5836e commit b8cc33352443fb3d26521345a3dd3ae9d9960b84 @danseid committed Nov 20, 2012
Showing with 26 additions and 5 deletions.
  1. +26 −5 README.md
View
31 README.md
@@ -34,23 +34,44 @@ Equal <matchfunction> should only be used on types, that implement equals functi
1 should be equal 1 //✔
2 should !be equal 1 //✔
"string" should be equal "string" //✔
- "string" should be equal "str" //✘
+ "string" should be equal "str" //✘
####be | !be any
Match the result to any object in a list
- 1 should be any of(1,2,3) //✔ of is a convenient function to create a list
- 1 should be any arrayList(1,2,3) //✔ same as above
+ 1 should be any of(1,2,3) //✔ of is a convenient function to create a list
+ 1 should be any arrayList(1,2,3) //✔ same as above
"abc" should be any of("cab", "bac", "abc") //✔
- 4 should !be any of(1,2,3) //✔
- 4 should !be any of (1,2,4) //✘
+ 4 should !be any of(1,2,3) //✔
+ 4 should !be any of (1,2,4) //✘
###String
+Matchers to use on String objects
####have | !have length
+ "string" should have length 6 //✔
+ "" should !have length 1 //✔
+ "string" should have length 0 //✘
####start | !start with
+ "string" should start with "str" //✔
+ "string" should !start with "tring" //✔
+ "string" should start with "ing" //✘
####end | !end with
+ "string" should end with "ing" //✔
+ "string" should !end with "in" //✔
+ "string" should end with "strin" //✘
####contain | !contain any
+ "string" should contain any of("s", "t", "a") //✔
+ "string" should !contain any of("a", "b", "c") //✔
+ "string" should contain any of("a", "b", "c") //✘
####contain | !contain all
+ "string" should contain all of("s", "t", "r") //✔
+ "string" should !contain all of("a", "b", "c") //✔
+ "string" should contain all of("s", "t", "a") //✘
###Function
+Matchers to use on () : R -> Function
####fail | !fail with
+ {throw NullPointerException()} should fail with NullPointerException() //✔
+ {1 should be equal 1} should !fail with AssertionError() //✔
+ {"string" should be equal "string"} should fail with AssertionError() //✘
+

0 comments on commit b8cc333

Please sign in to comment.
Something went wrong with that request. Please try again.