mirror of
https://github.com/discourse/discourse.git
synced 2024-12-26 04:53:44 +08:00
12 lines
329 B
Ruby
12 lines
329 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
RSpec::Matchers.define :have_constant do |const|
|
||
|
match { |owner| owner.const_defined?(const) }
|
||
|
|
||
|
failure_message { |owner| "expected #{owner} to have a constant #{const}" }
|
||
|
|
||
|
failure_message_when_negated do |owner|
|
||
|
"expected #{owner} not to have a constant #{const}, but it does"
|
||
|
end
|
||
|
end
|