sass-embedded 0.3.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,93 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'test_helper'
4
-
5
- module Sass
6
- class OutputStyleTest < MiniTest::Test
7
- def setup
8
- @embedded = Embedded.new
9
- end
10
-
11
- def teardown
12
- @embedded.close
13
- end
14
-
15
- def input_scss
16
- <<~CSS
17
- $color: #fff;
18
-
19
- #main {
20
- color: $color;
21
- background-color: #000;
22
- p {
23
- width: 10em;
24
- }
25
- }
26
-
27
- .huge {
28
- font-size: 10em;
29
- font-weight: bold;
30
- text-decoration: underline;
31
- }
32
- CSS
33
- end
34
-
35
- def expected_expanded_output
36
- <<~CSS.chomp
37
- #main {
38
- color: #fff;
39
- background-color: #000;
40
- }
41
- #main p {
42
- width: 10em;
43
- }
44
-
45
- .huge {
46
- font-size: 10em;
47
- font-weight: bold;
48
- text-decoration: underline;
49
- }
50
- CSS
51
- end
52
-
53
- def test_expanded_output_is_default
54
- output = @embedded.render(data: input_scss)[:css]
55
- assert_equal expected_expanded_output, output
56
- end
57
-
58
- def test_output_style_accepts_strings
59
- output = @embedded.render(data: input_scss, output_style: :expanded)[:css]
60
- assert_equal expected_expanded_output, output
61
- end
62
-
63
- def test_invalid_output_style
64
- assert_raises(ArgumentError) do
65
- @embedded.render(data: input_scss, output_style: :totally_wrong)[:css]
66
- end
67
- end
68
-
69
- def test_unsupported_output_style
70
- assert_raises(ArgumentError) do
71
- @embedded.render(data: input_scss, output_style: :nested)[:css]
72
- end
73
-
74
- assert_raises(ArgumentError) do
75
- @embedded.render(data: input_scss, output_style: :compact)[:css]
76
- end
77
- end
78
-
79
- def test_compressed_output
80
- output = @embedded.render(data: input_scss, output_style: :compressed)[:css]
81
- assert_equal <<~CSS.chomp, output
82
- #main{color:#fff;background-color:#000}#main p{width:10em}.huge{font-size:10em;font-weight:bold;text-decoration:underline}
83
- CSS
84
- end
85
-
86
- def test_string_output_style_names
87
- output = @embedded.render(data: input_scss, output_style: 'compressed')[:css]
88
- assert_equal <<~CSS.chomp, output
89
- #main{color:#fff;background-color:#000}#main p{width:10em}.huge{font-size:10em;font-weight:bold;text-decoration:underline}
90
- CSS
91
- end
92
- end
93
- end