Package org.jbehave.core.mock

Examples of org.jbehave.core.mock.UsingMatchers


        Exception exception = m.runAndCatch(IllegalArgumentException.class, EMPTY_BLOCK);
        Ensure.that(exception, m.isNull());
    }
   
    public void shouldCatchAndRethrowExceptionOfAnUnexpectedType() throws Exception {
        UsingMatchers m = new UsingMatchers() {};
       
        try {
            Exception exception = m.runAndCatch(UnsupportedOperationException.class, EXCEPTION_BLOCK);
            m.fail("Should have thrown IllegalArgumentException");
        } catch (IllegalArgumentException e) {
            // expected
        }
    }
View Full Code Here


            // expected
        }
    }
   
    public void shouldProvideConditionalMatchers() throws Exception {
        UsingMatchers m = new UsingMatchers() {};
       
        String horse = "horse";
        String cow = "cow";
       
        Ensure.that(horse, m.or(m.eq(horse), m.eq(cow)));
        Ensure.that(cow, m.either(m.eq(horse), m.eq(cow)));
       
        Ensure.that(horse, m.and(m.eq(horse), m.contains("ors")));
        Ensure.that(cow, m.both(m.eq(cow), m.endsWith("ow")));
    }
View Full Code Here

TOP

Related Classes of org.jbehave.core.mock.UsingMatchers

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.