class DescribeRelaxedMock(Spec): def before(self): self.m = Mock(strict=False) def it_should_not_raise_error_on_random_invocation(self): self.m.foo() def it_should_not_raise_error_on_random_invocations_with_certain_expectations(self): self.m.should_access.upper().and_return("bar") self.m.foo() Value(self.m).invoking.upper().should == "bar" @fails_verification def it_should_raise_error_when_certain_expectations_are_not_met(self): self.m.should_access.foo()