For readability I think it would be good to put parens around the grouped conditions:

``` ruby
              if (expect_data.is_a?(Regexp) && !expect_data.match(line)) || line != expect_data
```