Skip to content

Commit

Permalink
Merge pull request #76 from onehub/no-reference-parsing
Browse files Browse the repository at this point in the history
Make sure "No styleguide reference" doesn't blow up.
  • Loading branch information
benschwarz committed Jul 22, 2013
2 parents 0c86814 + 02afe6a commit b88d2df
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/kss/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Kss
# Public: The main KSS parser. Takes a directory full of SASS / SCSS / CSS
# files and parses the KSS within them.
class Parser
STYLEGUIDE_PATTERN = (/Styleguide [[:alnum:]]/i).freeze
STYLEGUIDE_PATTERN = (/(?<!No )Styleguide [[:alnum:]]/i).freeze

# Public: Returns a hash of Sections.
attr_accessor :sections
Expand Down
12 changes: 12 additions & 0 deletions test/parser_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,16 @@ def setup
assert_equal "Your standard text input box.", @sass_parsed.section('3.0.1').description
end

test "parse with no styleguide reference comment" do
scss_input =<<-'EOS'
// Nothing here
//
// No styleguide reference.
input[type="text"] {
border: 1px solid #ccc;
}
EOS

assert Kss::Parser.new(scss_input)
end
end

0 comments on commit b88d2df

Please sign in to comment.