parcels 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +22 -0
- data/.rspec-local +4 -0
- data/.travis.yml +54 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +6 -0
- data/lib/parcels/dependency_parcel_list.rb +50 -0
- data/lib/parcels/environment.rb +60 -0
- data/lib/parcels/fortitude/alongside_engine.rb +37 -0
- data/lib/parcels/fortitude/assets.rb +212 -0
- data/lib/parcels/fortitude/enabling.rb +72 -0
- data/lib/parcels/fortitude/fortitude_engine.rb +35 -0
- data/lib/parcels/fortitude/fortitude_loader.rb +27 -0
- data/lib/parcels/fortitude/widget_engine.rb +31 -0
- data/lib/parcels/fortitude_alongside_parcel.rb +38 -0
- data/lib/parcels/fortitude_inline_parcel.rb +31 -0
- data/lib/parcels/fortitude_parcel.rb +102 -0
- data/lib/parcels/fragments/css_fragment.rb +107 -0
- data/lib/parcels/index.rb +16 -0
- data/lib/parcels/rails/rails_loader.rb +23 -0
- data/lib/parcels/rails/railtie.rb +16 -0
- data/lib/parcels/sprockets.rb +153 -0
- data/lib/parcels/utils/path_utils.rb +32 -0
- data/lib/parcels/version.rb +3 -0
- data/lib/parcels/widget_tree.rb +158 -0
- data/lib/parcels.rb +21 -0
- data/parcels.gemspec +48 -0
- data/spec/helpers/content_in_helpers.rb +21 -0
- data/spec/helpers/file_structure_helpers.rb +79 -0
- data/spec/helpers/global_helper.rb +34 -0
- data/spec/helpers/new_asset_helpers.rb +31 -0
- data/spec/helpers/new_rails_helpers.rb +31 -0
- data/spec/helpers/parcels_rails_helpers.rb +20 -0
- data/spec/helpers/per_example_helpers.rb +15 -0
- data/spec/helpers/sprockets_helpers.rb +23 -0
- data/spec/lib/spec/expected/base_expected_asset.rb +35 -0
- data/spec/lib/spec/expected/expected_asset.rb +135 -0
- data/spec/lib/spec/expected/expected_asset_set.rb +45 -0
- data/spec/lib/spec/expected/must_not_be_present_asset.rb +17 -0
- data/spec/lib/spec/fixtures/file_set.rb +80 -0
- data/spec/lib/spec/fixtures/widget_base.rb +13 -0
- data/spec/lib/spec/fixtures/widget_file.rb +108 -0
- data/spec/lib/spec/parsing/compiled_asset.rb +94 -0
- data/spec/lib/spec/parsing/compiled_asset_fragment.rb +38 -0
- data/spec/lib/spec/parsing/parsed_css_asset.rb +34 -0
- data/spec/lib/spec/parsing/precompiled_rails_asset.rb +52 -0
- data/spec/lib/spec/parsing/rails_asset.rb +30 -0
- data/spec/lib/spec/parsing/sprockets_asset.rb +40 -0
- data/spec/rails/basic_rails_spec.rb +102 -0
- data/spec/rails/compression_rails_spec.rb +11 -0
- data/spec/rails/development_mode_rails_spec.rb +321 -0
- data/spec/rails/sass_rails_spec.rb +125 -0
- data/spec/rails/sets_rails_spec.rb +85 -0
- data/spec/rails/templates/base/app/assets/stylesheets/application.css +16 -0
- data/spec/rails/templates/base/app/views/widgets/base.rb +4 -0
- data/spec/rails/templates/base/config/environments/production.rb +92 -0
- data/spec/rails/templates/base/lib/null_compressor.rb +5 -0
- data/spec/rails/templates/basic_rails_spec/app/controllers/basic_rails_spec_controller.rb +21 -0
- data/spec/rails/templates/basic_rails_spec/app/views/basic_rails_spec/alongside_and_inline.pcss +1 -0
- data/spec/rails/templates/basic_rails_spec/app/views/basic_rails_spec/alongside_and_inline.rb +9 -0
- data/spec/rails/templates/basic_rails_spec/app/views/basic_rails_spec/alongside_and_inline_html.html.pcss +1 -0
- data/spec/rails/templates/basic_rails_spec/app/views/basic_rails_spec/alongside_and_inline_html.html.rb +9 -0
- data/spec/rails/templates/basic_rails_spec/app/views/basic_rails_spec/alongside_erb.pcss +1 -0
- data/spec/rails/templates/basic_rails_spec/app/views/basic_rails_spec/alongside_erb.rb +7 -0
- data/spec/rails/templates/basic_rails_spec/app/views/basic_rails_spec/inline_erb.rb +9 -0
- data/spec/rails/templates/basic_rails_spec/app/views/basic_rails_spec/multiple_engines.pcss +1 -0
- data/spec/rails/templates/basic_rails_spec/app/views/basic_rails_spec/multiple_engines.rb +9 -0
- data/spec/rails/templates/basic_rails_spec/app/views/basic_rails_spec/no_corresponding_widget.pcss +1 -0
- data/spec/rails/templates/basic_rails_spec/app/views/basic_rails_spec/simple_css.rb +9 -0
- data/spec/rails/templates/compression_rails_spec/app/controllers/compression_rails_spec_controller.rb +5 -0
- data/spec/rails/templates/compression_rails_spec/app/views/compression_rails_spec/inline_and_alongside_css.pcss +1 -0
- data/spec/rails/templates/compression_rails_spec/app/views/compression_rails_spec/inline_and_alongside_css.rb +9 -0
- data/spec/rails/templates/compression_rails_spec/config/environments/production.rb +91 -0
- data/spec/rails/templates/development_mode_rails_spec/app/assets/stylesheets/changingone.scss +1 -0
- data/spec/rails/templates/development_mode_rails_spec/app/assets/stylesheets/changingtwo.scss +1 -0
- data/spec/rails/templates/development_mode_rails_spec/app/assets/stylesheets/import_dir/import_dir_ss_1.scss +1 -0
- data/spec/rails/templates/development_mode_rails_spec/app/controllers/development_mode_rails_spec_controller.rb +45 -0
- data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/adding_alongside_css.rb +5 -0
- data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/adding_inline_css.rb +7 -0
- data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/adding_widget.rb +5 -0
- data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/basic_widget_with_inline_and_alongside_parcels.pcss +3 -0
- data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/basic_widget_with_inline_and_alongside_parcels.rb +9 -0
- data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/changing_alongside_css.pcss +1 -0
- data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/changing_alongside_css.rb +5 -0
- data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/changing_import_file.pcss +2 -0
- data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/changing_import_file.rb +10 -0
- data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/changing_inline_css.rb +9 -0
- data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/changing_prefix_imported_file.pcss +1 -0
- data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/changing_prefix_imported_file.rb +7 -0
- data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/removing_alongside_css.pcss +1 -0
- data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/removing_alongside_css.rb +5 -0
- data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/removing_inline_css.rb +7 -0
- data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/removing_widget.pcss +1 -0
- data/spec/rails/templates/development_mode_rails_spec/app/views/development_mode_rails_spec/removing_widget.rb +9 -0
- data/spec/rails/templates/development_mode_rails_spec/app/views/import_base.rb +5 -0
- data/spec/rails/templates/development_mode_rails_spec/config/environments/development.rb +37 -0
- data/spec/rails/templates/development_mode_rails_spec/vendor/assets/stylesheets/one.scss +1 -0
- data/spec/rails/templates/development_mode_rails_spec/vendor/assets/stylesheets/two.scss +1 -0
- data/spec/rails/templates/sass_rails_spec/app/assets/foobar/the_import_dir_2/id2ss1.scss +1 -0
- data/spec/rails/templates/sass_rails_spec/app/assets/foobar/the_import_dir_2/id2ss2.scss +1 -0
- data/spec/rails/templates/sass_rails_spec/app/assets/foobar/twelve.scss +1 -0
- data/spec/rails/templates/sass_rails_spec/app/assets/foobar/two.scss +1 -0
- data/spec/rails/templates/sass_rails_spec/app/assets/images/quux/foo.png +0 -0
- data/spec/rails/templates/sass_rails_spec/app/assets/stylesheets/eleven.scss +1 -0
- data/spec/rails/templates/sass_rails_spec/app/assets/stylesheets/one.scss +1 -0
- data/spec/rails/templates/sass_rails_spec/app/assets/stylesheets/shared_import_dir/sid1ss1.scss +1 -0
- data/spec/rails/templates/sass_rails_spec/app/assets/stylesheets/shared_import_dir/sid1ss2.scss +1 -0
- data/spec/rails/templates/sass_rails_spec/app/assets/stylesheets/the_import_dir_1/id1ss1.scss +1 -0
- data/spec/rails/templates/sass_rails_spec/app/assets/stylesheets/the_import_dir_1/id1ss2.scss +1 -0
- data/spec/rails/templates/sass_rails_spec/app/controllers/sass_rails_spec_controller.rb +29 -0
- data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/added_asset_path.pcss +2 -0
- data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/added_asset_path.rb +10 -0
- data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/asset_url.pcss +2 -0
- data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/asset_url.rb +17 -0
- data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/default_sass_import.pcss +6 -0
- data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/default_sass_import.rb +14 -0
- data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/import_directory.pcss +3 -0
- data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/import_directory.rb +11 -0
- data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/import_view_relative_directory.pcss +3 -0
- data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/import_view_relative_directory.rb +11 -0
- data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/other_features.pcss +1 -0
- data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/other_features.rb +9 -0
- data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/shared_imports.rb +10 -0
- data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/vr_import_dir_1/vr1ss1.scss +1 -0
- data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/vr_import_dir_1/vr1ss2.scss +1 -0
- data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/vr_import_dir_2/vr2ss1.scss +1 -0
- data/spec/rails/templates/sass_rails_spec/app/views/sass_rails_spec/vr_import_dir_2/vr2ss2.scss +1 -0
- data/spec/rails/templates/sass_rails_spec/app/views/widgets/import_base.rb +5 -0
- data/spec/rails/templates/sass_rails_spec/config/application.rb +25 -0
- data/spec/rails/templates/sass_rails_spec/lib/more_assets/twenty.scss +1 -0
- data/spec/rails/templates/sass_rails_spec/vendor/assets/stylesheets/thirteen.scss +1 -0
- data/spec/rails/templates/sass_rails_spec/vendor/assets/stylesheets/three.scss +1 -0
- data/spec/rails/templates/sets_rails_spec/app/assets/stylesheets/admin.css.scss +1 -0
- data/spec/rails/templates/sets_rails_spec/app/assets/stylesheets/all.css.scss +1 -0
- data/spec/rails/templates/sets_rails_spec/app/assets/stylesheets/normal.css.scss +1 -0
- data/spec/rails/templates/sets_rails_spec/app/controllers/sets_rails_spec_controller.rb +3 -0
- data/spec/rails/templates/sets_rails_spec/app/views/admin/admin_one.pcss +1 -0
- data/spec/rails/templates/sets_rails_spec/app/views/admin/admin_one.rb +3 -0
- data/spec/rails/templates/sets_rails_spec/app/views/admin/admin_two.pcss +1 -0
- data/spec/rails/templates/sets_rails_spec/app/views/admin/admin_two.rb +3 -0
- data/spec/rails/templates/sets_rails_spec/app/views/admin/base.rb +3 -0
- data/spec/rails/templates/sets_rails_spec/app/views/root.rb +9 -0
- data/spec/rails/templates/sets_rails_spec/app/views/sets_base.rb +3 -0
- data/spec/rails/templates/sets_rails_spec/app/views/sets_rails_spec/normal_one.pcss +1 -0
- data/spec/rails/templates/sets_rails_spec/app/views/sets_rails_spec/normal_one.rb +3 -0
- data/spec/rails/templates/sets_rails_spec/app/views/sets_rails_spec/normal_two.pcss +1 -0
- data/spec/rails/templates/sets_rails_spec/app/views/sets_rails_spec/normal_two.rb +3 -0
- data/spec/system/alongside_file_spec.rb +193 -0
- data/spec/system/autogenerated_class_application_spec.rb +240 -0
- data/spec/system/basic_system_spec.rb +75 -0
- data/spec/system/dependency_sorting_spec.rb +48 -0
- data/spec/system/engines_spec.rb +245 -0
- data/spec/system/prefix_spec.rb +108 -0
- data/spec/system/sass_features_spec.rb +109 -0
- data/spec/system/sets_spec.rb +405 -0
- metadata +477 -0
@@ -0,0 +1,405 @@
|
|
1
|
+
describe "Parcels sets", :type => :system do
|
2
|
+
context "with widgets in various sets" do
|
3
|
+
before :each do
|
4
|
+
files {
|
5
|
+
file 'assets/one.css', %{
|
6
|
+
//= require_parcels
|
7
|
+
}
|
8
|
+
|
9
|
+
file 'assets/two.css', %{
|
10
|
+
//= require_parcels aaa
|
11
|
+
}
|
12
|
+
|
13
|
+
file 'assets/three.css', %{
|
14
|
+
//= require_parcels bbb
|
15
|
+
}
|
16
|
+
|
17
|
+
file 'assets/four.css', %{
|
18
|
+
//= require_parcels aaa bbb
|
19
|
+
}
|
20
|
+
|
21
|
+
file 'assets/five.css', %{
|
22
|
+
//= require_parcels aaa, bbb
|
23
|
+
}
|
24
|
+
|
25
|
+
widget 'views/parent_widget' do
|
26
|
+
css %{
|
27
|
+
p { color: red; }
|
28
|
+
}
|
29
|
+
|
30
|
+
sets :aaa
|
31
|
+
end
|
32
|
+
|
33
|
+
widget 'views/widget_one', :superclass => 'Views::ParentWidget' do
|
34
|
+
requires %{views/parent_widget}
|
35
|
+
css %{div { color: green; }}
|
36
|
+
end
|
37
|
+
|
38
|
+
file 'views/widget_one.pcss', %{
|
39
|
+
div.a { color: green; }
|
40
|
+
}
|
41
|
+
|
42
|
+
widget 'views/widget_two', :superclass => 'Views::ParentWidget' do
|
43
|
+
requires %{views/parent_widget}
|
44
|
+
css %{span { color: blue; }}
|
45
|
+
sets :bbb
|
46
|
+
end
|
47
|
+
|
48
|
+
file 'views/widget_two.pcss', %{
|
49
|
+
span.a { color: blue; }
|
50
|
+
}
|
51
|
+
|
52
|
+
widget 'views/widget_three', :superclass => 'Views::ParentWidget' do
|
53
|
+
requires %{views/parent_widget}
|
54
|
+
css %{em { color: yellow; }}
|
55
|
+
sets :aaa, :bbb
|
56
|
+
end
|
57
|
+
|
58
|
+
file 'views/widget_three.pcss', %{
|
59
|
+
em.a { color: yellow; }
|
60
|
+
}
|
61
|
+
|
62
|
+
widget 'views/widget_four', :superclass => 'Views::ParentWidget' do
|
63
|
+
requires %{views/parent_widget}
|
64
|
+
css %{strong { color: cyan; }}
|
65
|
+
sets nil
|
66
|
+
end
|
67
|
+
|
68
|
+
file 'views/widget_four.pcss', %{
|
69
|
+
strong.a { color: cyan; }
|
70
|
+
}
|
71
|
+
|
72
|
+
widget 'views/widget_five', :superclass => 'Views::ParentWidget' do
|
73
|
+
requires %{views/parent_widget}
|
74
|
+
css %{h1 { color: magenta; }}
|
75
|
+
sets :aaa
|
76
|
+
end
|
77
|
+
|
78
|
+
file 'views/widget_five.pcss', %{
|
79
|
+
h1.a { color: magenta; }
|
80
|
+
}
|
81
|
+
|
82
|
+
widget 'views/widget_six', :superclass => 'Views::ParentWidget' do
|
83
|
+
requires %{views/parent_widget}
|
84
|
+
css %{h2 { color: black; }}
|
85
|
+
sets_block %{do |klass, filename|
|
86
|
+
if klass.name =~ /seven/i
|
87
|
+
[ :aaa, :bbb ]
|
88
|
+
elsif filename =~ /widget_eight/i
|
89
|
+
:aaa
|
90
|
+
else
|
91
|
+
:bbb
|
92
|
+
end
|
93
|
+
end
|
94
|
+
}
|
95
|
+
end
|
96
|
+
|
97
|
+
file 'views/widget_six.pcss', %{
|
98
|
+
h2.a { color: black; }
|
99
|
+
}
|
100
|
+
|
101
|
+
widget 'views/widget_seven', :superclass => 'Views::WidgetSix' do
|
102
|
+
requires %{views/widget_six}
|
103
|
+
css %{h3 { color: white; }}
|
104
|
+
end
|
105
|
+
|
106
|
+
file 'views/widget_seven.pcss', %{
|
107
|
+
h3.a { color: white; }
|
108
|
+
}
|
109
|
+
|
110
|
+
widget 'views/widget_eight', :superclass => 'Views::WidgetSix' do
|
111
|
+
requires %{views/widget_six}
|
112
|
+
css %{h4 { color: red; }}
|
113
|
+
end
|
114
|
+
|
115
|
+
file 'views/widget_eight.pcss', %{
|
116
|
+
h4.a { color: red; }
|
117
|
+
}
|
118
|
+
}
|
119
|
+
end
|
120
|
+
|
121
|
+
it "should put everything in if you don't specify any sets" do
|
122
|
+
compiled_sprockets_asset('one').should_match(file_assets do
|
123
|
+
asset 'views/parent_widget.rb' do
|
124
|
+
expect_wrapped_rule :p, 'color: red'
|
125
|
+
end
|
126
|
+
|
127
|
+
asset 'views/widget_one.rb' do
|
128
|
+
expect_wrapped_rule :div, 'color: green'
|
129
|
+
end
|
130
|
+
|
131
|
+
asset 'views/widget_one.pcss' do
|
132
|
+
expect_wrapped_rule :'div.a', 'color: green'
|
133
|
+
end
|
134
|
+
|
135
|
+
asset 'views/widget_two.rb' do
|
136
|
+
expect_wrapped_rule :span, 'color: blue'
|
137
|
+
end
|
138
|
+
|
139
|
+
asset 'views/widget_two.pcss' do
|
140
|
+
expect_wrapped_rule :'span.a', 'color: blue'
|
141
|
+
end
|
142
|
+
|
143
|
+
asset 'views/widget_three.rb' do
|
144
|
+
expect_wrapped_rule :em, 'color: yellow'
|
145
|
+
end
|
146
|
+
|
147
|
+
asset 'views/widget_three.pcss' do
|
148
|
+
expect_wrapped_rule :'em.a', 'color: yellow'
|
149
|
+
end
|
150
|
+
|
151
|
+
asset 'views/widget_four.rb' do
|
152
|
+
expect_wrapped_rule :strong, 'color: cyan'
|
153
|
+
end
|
154
|
+
|
155
|
+
asset 'views/widget_four.pcss' do
|
156
|
+
expect_wrapped_rule :'strong.a', 'color: cyan'
|
157
|
+
end
|
158
|
+
|
159
|
+
asset 'views/widget_five.rb' do
|
160
|
+
expect_wrapped_rule :h1, 'color: magenta'
|
161
|
+
end
|
162
|
+
|
163
|
+
asset 'views/widget_five.pcss' do
|
164
|
+
expect_wrapped_rule :'h1.a', 'color: magenta'
|
165
|
+
end
|
166
|
+
|
167
|
+
asset 'views/widget_six.rb' do
|
168
|
+
expect_wrapped_rule :h2, 'color: black'
|
169
|
+
end
|
170
|
+
|
171
|
+
asset 'views/widget_six.pcss' do
|
172
|
+
expect_wrapped_rule :'h2.a', 'color: black'
|
173
|
+
end
|
174
|
+
|
175
|
+
asset 'views/widget_seven.rb' do
|
176
|
+
expect_wrapped_rule :h3, 'color: white'
|
177
|
+
end
|
178
|
+
|
179
|
+
asset 'views/widget_seven.pcss' do
|
180
|
+
expect_wrapped_rule :'h3.a', 'color: white'
|
181
|
+
end
|
182
|
+
|
183
|
+
asset 'views/widget_eight.rb' do
|
184
|
+
expect_wrapped_rule :h4, 'color: red'
|
185
|
+
end
|
186
|
+
|
187
|
+
asset 'views/widget_eight.pcss' do
|
188
|
+
expect_wrapped_rule :'h4.a', 'color: red'
|
189
|
+
end
|
190
|
+
end)
|
191
|
+
end
|
192
|
+
|
193
|
+
it "should put in just that one set if that's what you ask for" do
|
194
|
+
compiled_sprockets_asset('two').should_match(file_assets do
|
195
|
+
asset 'views/parent_widget.rb' do
|
196
|
+
expect_wrapped_rule :p, 'color: red'
|
197
|
+
end
|
198
|
+
|
199
|
+
asset 'views/widget_one.rb' do
|
200
|
+
expect_wrapped_rule :div, 'color: green'
|
201
|
+
end
|
202
|
+
|
203
|
+
asset 'views/widget_one.pcss' do
|
204
|
+
expect_wrapped_rule :'div.a', 'color: green'
|
205
|
+
end
|
206
|
+
|
207
|
+
asset 'views/widget_three.rb' do
|
208
|
+
expect_wrapped_rule :em, 'color: yellow'
|
209
|
+
end
|
210
|
+
|
211
|
+
asset 'views/widget_three.pcss' do
|
212
|
+
expect_wrapped_rule :'em.a', 'color: yellow'
|
213
|
+
end
|
214
|
+
|
215
|
+
asset 'views/widget_five.rb' do
|
216
|
+
expect_wrapped_rule :h1, 'color: magenta'
|
217
|
+
end
|
218
|
+
|
219
|
+
asset 'views/widget_five.pcss' do
|
220
|
+
expect_wrapped_rule :'h1.a', 'color: magenta'
|
221
|
+
end
|
222
|
+
|
223
|
+
asset 'views/widget_seven.rb' do
|
224
|
+
expect_wrapped_rule :h3, 'color: white'
|
225
|
+
end
|
226
|
+
|
227
|
+
asset 'views/widget_seven.pcss' do
|
228
|
+
expect_wrapped_rule :'h3.a', 'color: white'
|
229
|
+
end
|
230
|
+
|
231
|
+
asset 'views/widget_eight.rb' do
|
232
|
+
expect_wrapped_rule :h4, 'color: red'
|
233
|
+
end
|
234
|
+
|
235
|
+
asset 'views/widget_eight.pcss' do
|
236
|
+
expect_wrapped_rule :'h4.a', 'color: red'
|
237
|
+
end
|
238
|
+
end)
|
239
|
+
end
|
240
|
+
|
241
|
+
it "should put in just the other set if that's what you ask for" do
|
242
|
+
compiled_sprockets_asset('three').should_match(file_assets do
|
243
|
+
asset 'views/widget_two.rb' do
|
244
|
+
expect_wrapped_rule :span, 'color: blue'
|
245
|
+
end
|
246
|
+
|
247
|
+
asset 'views/widget_two.pcss' do
|
248
|
+
expect_wrapped_rule :'span.a', 'color: blue'
|
249
|
+
end
|
250
|
+
|
251
|
+
asset 'views/widget_three.rb' do
|
252
|
+
expect_wrapped_rule :em, 'color: yellow'
|
253
|
+
end
|
254
|
+
|
255
|
+
asset 'views/widget_three.pcss' do
|
256
|
+
expect_wrapped_rule :'em.a', 'color: yellow'
|
257
|
+
end
|
258
|
+
|
259
|
+
asset 'views/widget_six.rb' do
|
260
|
+
expect_wrapped_rule :h2, 'color: black'
|
261
|
+
end
|
262
|
+
|
263
|
+
asset 'views/widget_six.pcss' do
|
264
|
+
expect_wrapped_rule :'h2.a', 'color: black'
|
265
|
+
end
|
266
|
+
|
267
|
+
asset 'views/widget_seven.rb' do
|
268
|
+
expect_wrapped_rule :h3, 'color: white'
|
269
|
+
end
|
270
|
+
|
271
|
+
asset 'views/widget_seven.pcss' do
|
272
|
+
expect_wrapped_rule :'h3.a', 'color: white'
|
273
|
+
end
|
274
|
+
end)
|
275
|
+
end
|
276
|
+
|
277
|
+
it "should let you separate set names with a comma, and still work fine" do
|
278
|
+
compiled_sprockets_asset('five').should_match(file_assets do
|
279
|
+
asset 'views/parent_widget.rb' do
|
280
|
+
expect_wrapped_rule :p, 'color: red'
|
281
|
+
end
|
282
|
+
|
283
|
+
asset 'views/widget_one.rb' do
|
284
|
+
expect_wrapped_rule :div, 'color: green'
|
285
|
+
end
|
286
|
+
|
287
|
+
asset 'views/widget_one.pcss' do
|
288
|
+
expect_wrapped_rule :'div.a', 'color: green'
|
289
|
+
end
|
290
|
+
|
291
|
+
asset 'views/widget_two.rb' do
|
292
|
+
expect_wrapped_rule :span, 'color: blue'
|
293
|
+
end
|
294
|
+
|
295
|
+
asset 'views/widget_two.pcss' do
|
296
|
+
expect_wrapped_rule :'span.a', 'color: blue'
|
297
|
+
end
|
298
|
+
|
299
|
+
asset 'views/widget_three.rb' do
|
300
|
+
expect_wrapped_rule :em, 'color: yellow'
|
301
|
+
end
|
302
|
+
|
303
|
+
asset 'views/widget_three.pcss' do
|
304
|
+
expect_wrapped_rule :'em.a', 'color: yellow'
|
305
|
+
end
|
306
|
+
|
307
|
+
asset 'views/widget_five.rb' do
|
308
|
+
expect_wrapped_rule :h1, 'color: magenta'
|
309
|
+
end
|
310
|
+
|
311
|
+
asset 'views/widget_five.pcss' do
|
312
|
+
expect_wrapped_rule :'h1.a', 'color: magenta'
|
313
|
+
end
|
314
|
+
|
315
|
+
asset 'views/widget_six.rb' do
|
316
|
+
expect_wrapped_rule :h2, 'color: black'
|
317
|
+
end
|
318
|
+
|
319
|
+
asset 'views/widget_six.pcss' do
|
320
|
+
expect_wrapped_rule :'h2.a', 'color: black'
|
321
|
+
end
|
322
|
+
|
323
|
+
asset 'views/widget_seven.rb' do
|
324
|
+
expect_wrapped_rule :h3, 'color: white'
|
325
|
+
end
|
326
|
+
|
327
|
+
asset 'views/widget_seven.pcss' do
|
328
|
+
expect_wrapped_rule :'h3.a', 'color: white'
|
329
|
+
end
|
330
|
+
|
331
|
+
asset 'views/widget_eight.rb' do
|
332
|
+
expect_wrapped_rule :h4, 'color: red'
|
333
|
+
end
|
334
|
+
|
335
|
+
asset 'views/widget_eight.pcss' do
|
336
|
+
expect_wrapped_rule :'h4.a', 'color: red'
|
337
|
+
end
|
338
|
+
end)
|
339
|
+
end
|
340
|
+
|
341
|
+
it "should put in both sets if you ask, but not things with no sets at all" do
|
342
|
+
compiled_sprockets_asset('four').should_match(file_assets do
|
343
|
+
asset 'views/parent_widget.rb' do
|
344
|
+
expect_wrapped_rule :p, 'color: red'
|
345
|
+
end
|
346
|
+
|
347
|
+
asset 'views/widget_one.rb' do
|
348
|
+
expect_wrapped_rule :div, 'color: green'
|
349
|
+
end
|
350
|
+
|
351
|
+
asset 'views/widget_one.pcss' do
|
352
|
+
expect_wrapped_rule :'div.a', 'color: green'
|
353
|
+
end
|
354
|
+
|
355
|
+
asset 'views/widget_two.rb' do
|
356
|
+
expect_wrapped_rule :span, 'color: blue'
|
357
|
+
end
|
358
|
+
|
359
|
+
asset 'views/widget_two.pcss' do
|
360
|
+
expect_wrapped_rule :'span.a', 'color: blue'
|
361
|
+
end
|
362
|
+
|
363
|
+
asset 'views/widget_three.rb' do
|
364
|
+
expect_wrapped_rule :em, 'color: yellow'
|
365
|
+
end
|
366
|
+
|
367
|
+
asset 'views/widget_three.pcss' do
|
368
|
+
expect_wrapped_rule :'em.a', 'color: yellow'
|
369
|
+
end
|
370
|
+
|
371
|
+
asset 'views/widget_five.rb' do
|
372
|
+
expect_wrapped_rule :h1, 'color: magenta'
|
373
|
+
end
|
374
|
+
|
375
|
+
asset 'views/widget_five.pcss' do
|
376
|
+
expect_wrapped_rule :'h1.a', 'color: magenta'
|
377
|
+
end
|
378
|
+
|
379
|
+
asset 'views/widget_six.rb' do
|
380
|
+
expect_wrapped_rule :h2, 'color: black'
|
381
|
+
end
|
382
|
+
|
383
|
+
asset 'views/widget_six.pcss' do
|
384
|
+
expect_wrapped_rule :'h2.a', 'color: black'
|
385
|
+
end
|
386
|
+
|
387
|
+
asset 'views/widget_seven.rb' do
|
388
|
+
expect_wrapped_rule :h3, 'color: white'
|
389
|
+
end
|
390
|
+
|
391
|
+
asset 'views/widget_seven.pcss' do
|
392
|
+
expect_wrapped_rule :'h3.a', 'color: white'
|
393
|
+
end
|
394
|
+
|
395
|
+
asset 'views/widget_eight.rb' do
|
396
|
+
expect_wrapped_rule :h4, 'color: red'
|
397
|
+
end
|
398
|
+
|
399
|
+
asset 'views/widget_eight.pcss' do
|
400
|
+
expect_wrapped_rule :'h4.a', 'color: red'
|
401
|
+
end
|
402
|
+
end)
|
403
|
+
end
|
404
|
+
end
|
405
|
+
end
|