Skip to content

Commit 0560296

Browse files
committed
Allow write matcher to take nil, :something, :anything or a Regexp in addition to a String.
1 parent 935bc75 commit 0560296

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

lib/rdf/spec/matchers.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,14 @@ module Matchers
194194
when :error then fake_stderr(&block)
195195
else raise("Allowed values for `to` are :output and :error, got `#{io.inspect}`")
196196
end
197-
@output.include? message
197+
case message
198+
when nil, :something, :anything
199+
!@output.empty?
200+
when Regexp
201+
message.match(@output)
202+
else
203+
@output.include? message
204+
end
198205
end
199206

200207
description do

0 commit comments

Comments
 (0)