Module: Spec::Matchers

Included in:
BBCStandards::Validator
Defined in:
lib/bbc_standards/rspec.rb

Instance Method Summary collapse

Instance Method Details

#obey_bbc_standardsObject



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/bbc_standards/rspec.rb', line 3

def obey_bbc_standards
  Matcher.new :obey_bbc_standards do
    validator = nil
    match do |xhtml|
      validator = BBCStandards::Validator.new xhtml
      validator.valid?
    end

    failure_message_for_should do |actual|
      validator.inspect
    end
  end
end