test/extra/checking/checks/test_css.rb in nanoc-3.7.4 vs test/extra/checking/checks/test_css.rb in nanoc-3.7.5
- old
+ new
@@ -1,9 +1,8 @@
# encoding: utf-8
class Nanoc::Extra::Checking::Checks::CSSTest < Nanoc::TestCase
-
def test_run_ok
VCR.use_cassette('css_run_ok') do
with_site do |site|
# Create files
FileUtils.mkdir_p('output')
@@ -32,11 +31,33 @@
check = Nanoc::Extra::Checking::Checks::CSS.new(site)
check.run
# Check
refute check.issues.empty?
+ assert_equal 1, check.issues.size
+ assert_equal 'line 1: Property coxlor doesn\'t exist: h1 { coxlor: rxed; }',
+ check.issues.to_a[0].description
end
end
end
-end
+ def test_run_parse_error
+ VCR.use_cassette('css_run_parse_error') do
+ with_site do |site|
+ # Create files
+ FileUtils.mkdir_p('output')
+ File.open('output/blah.html', 'w') { |io| io.write('<h1>Hi!</h1>') }
+ File.open('output/style.css', 'w') { |io| io.write('h1 { ; {') }
+ # Run check
+ check = Nanoc::Extra::Checking::Checks::CSS.new(site)
+ check.run
+
+ # Check
+ refute check.issues.empty?
+ assert_equal 1, check.issues.size
+ assert_equal 'line 1: Parse Error: h1 { ; {',
+ check.issues.to_a[0].description
+ end
+ end
+ end
+end