class BeValidAsset::BeValidCss
Public Class Methods
new(profile)
click to toggle source
# File lib/be_valid_asset/be_valid_css.rb, line 10 def initialize(profile) @profile = profile end
Public Instance Methods
description()
click to toggle source
# File lib/be_valid_asset/be_valid_css.rb, line 27 def description "be valid css" end
failure_message()
click to toggle source
# File lib/be_valid_asset/be_valid_css.rb, line 31 def failure_message " expected css to be valid, but validation produced these errors:\n#{@message}" end
failure_message_when_negated()
click to toggle source
# File lib/be_valid_asset/be_valid_css.rb, line 35 def failure_message_when_negated " expected to not be valid, but was (missing validation?)" end
Also aliased as: negative_failure_message
matches?(fragment)
click to toggle source
# File lib/be_valid_asset/be_valid_css.rb, line 14 def matches?(fragment) if fragment.respond_to? :body fragment = fragment.body.to_s end # The validator return a 500 Error if it's sent empty string fragment = ' ' if fragment.empty? query_params = { :text => fragment, :profile => @profile, :vextwarning => 'true' } return validate(query_params) end
Private Instance Methods
error_line_prefix()
click to toggle source
# File lib/be_valid_asset/be_valid_css.rb, line 51 def error_line_prefix 'Invalid css' end
validator_host()
click to toggle source
# File lib/be_valid_asset/be_valid_css.rb, line 43 def validator_host Configuration.css_validator_host end
validator_path()
click to toggle source
# File lib/be_valid_asset/be_valid_css.rb, line 47 def validator_path Configuration.css_validator_path end