From a8ec2186d060d19766516771f71f9da225856852 Mon Sep 17 00:00:00 2001 From: JohnAlbin Date: Sun, 4 Jan 2015 15:19:02 +0800 Subject: [PATCH] Add test for optional trailing period in Styleguide reference. --- test/fixtures/css/buttons.css | 8 ++++++++ test/parser_test.rb | 7 ++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/test/fixtures/css/buttons.css b/test/fixtures/css/buttons.css index c426a4d..27654f2 100644 --- a/test/fixtures/css/buttons.css +++ b/test/fixtures/css/buttons.css @@ -37,6 +37,14 @@ a.button.star { a.button.star.disabled { opacity: 0.5; } +/* +Test that trailing period is stripped from the reference. + +Styleguide 2.2.2. +*/ +a.button.trailing:after { + content: '.'; } + /* A big button diff --git a/test/parser_test.rb b/test/parser_test.rb index 00b6a5b..1114c29 100644 --- a/test/parser_test.rb +++ b/test/parser_test.rb @@ -50,6 +50,11 @@ def setup @css_parsed.section('2.1.1').description end + test "parses KSS keys that have a trailing period" do + assert_equal 'Test that trailing period is stripped from the reference.', + @css_parsed.section('2.2.2').description + end + test "parses KSS keys that are words in CSS" do assert_equal 'A big button', @css_parsed.section('Buttons.Big').description @@ -76,7 +81,7 @@ def setup end test "public sections returns hash of sections" do - assert_equal 5, @css_parsed.sections.count + assert_equal 6, @css_parsed.sections.count end test "parse multiple paths" do