Guest User

Untitled

a guest
Apr 26th, 2012
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 0.29 KB | None | 0 0
  1. import groovy.mock.interceptor.MockFor
  2.  
  3. class Pet{
  4.    String name
  5. }
  6.  
  7.  
  8. def mocker = new MockFor(Pet.class)
  9. mocker.demand.asBoolean(){
  10.    false
  11. }
  12.  
  13.  
  14. mocker.use{
  15.    def _pet = new Pet()
  16.  
  17.    if(_pet){
  18.       println '_pet is true'
  19.    }else{
  20.       println '_pet is false'
  21.    }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment