forked from kneath/kss
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsection_test.rb
More file actions
42 lines (30 loc) · 943 Bytes
/
Copy pathsection_test.rb
File metadata and controls
42 lines (30 loc) · 943 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
require 'test/helper'
class SectionTest < Kss::Test
def setup
@comment_text = <<comment
# Form Button
Your standard form button.
:hover - Highlights when hovering.
:disabled - Dims the button when disabled.
.primary - Indicates button is the primary action.
.smaller - A smaller button
Styleguide 2.1.1.
comment
@section = Kss::Section.new(@comment_text, 'example.css')
end
test "parses the description" do
assert_equal "# Form Button\n\nYour standard form button.", @section.description
end
test "parses the modifiers" do
assert_equal 4, @section.modifiers.size
end
test "parses a modifier's names" do
assert_equal ':hover', @section.modifiers.first.name
end
test "parses a modifier's description" do
assert_equal 'Highlights when hovering.', @section.modifiers.first.description
end
test "parses the styleguide reference" do
assert_equal '2.1.1', @section.section
end
end