The problem is that if you expect:

```ruby
Puppet.expects(:debug).once.with {|msg| msg =~ /foo/}
```

And the code does:

```ruby
Puppet.debug 'foo'

...

Puppet.debug 'bar'
...
Puppet.debug 'baz'
```

The other debug messages `bar` and `baz` will cause the test to fail even though you're only interested in the behavior messages that are logging `foo`.