middleman-more 3.0.0.alpha.7
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.
- data/Rakefile +5 -0
- data/features/asset_host_compass.feature +7 -0
- data/features/cache_buster.feature +26 -0
- data/features/coffee-script.feature +17 -0
- data/features/content_for.feature +11 -0
- data/features/fonts.feature +13 -0
- data/features/ignore_already_minified.features +12 -0
- data/features/liquid.feature +11 -0
- data/features/markdown.feature +27 -0
- data/features/minify_css.feature +19 -0
- data/features/minify_javascript.feature +55 -0
- data/features/relative_assets.feature +50 -0
- data/features/sass_partials.feature +83 -0
- data/features/scss-support.feature +12 -0
- data/features/slim.feature +7 -0
- data/features/sprockets.feature +52 -0
- data/features/sprockets_gems.feature +10 -0
- data/features/support/env.rb +7 -0
- data/fixtures/already-minified-app/config.rb +2 -0
- data/fixtures/already-minified-app/source/javascripts/test.min.js +10 -0
- data/fixtures/already-minified-app/source/stylesheets/test.min.css +10 -0
- data/fixtures/asset-host-app/config.rb +6 -0
- data/fixtures/asset-host-app/source/.htaccess +1 -0
- data/fixtures/asset-host-app/source/images/blank.gif +0 -0
- data/fixtures/asset-host-app/source/stylesheets/asset_host.css.sass +3 -0
- data/fixtures/cache-buster-app/config.rb +0 -0
- data/fixtures/cache-buster-app/source/cache-buster.html.erb +2 -0
- data/fixtures/cache-buster-app/source/images/blank.gif +0 -0
- data/fixtures/cache-buster-app/source/stylesheets/relative_assets.css.sass +3 -0
- data/fixtures/cache-buster-app/source/stylesheets/site.css.sass +1 -0
- data/fixtures/coffeescript-app/config.rb +1 -0
- data/fixtures/coffeescript-app/source/inline-coffeescript.html.haml +3 -0
- data/fixtures/coffeescript-app/source/javascripts/broken-coffee.js.coffee +3 -0
- data/fixtures/coffeescript-app/source/javascripts/coffee_test.js.coffee +3 -0
- data/fixtures/content-for-app/config.rb +6 -0
- data/fixtures/content-for-app/source/content_for_haml.html.haml +4 -0
- data/fixtures/content-for-app/source/content_for_slim.html.slim +4 -0
- data/fixtures/content-for-app/source/layouts/content_for.erb +4 -0
- data/fixtures/fonts-app/config.rb +0 -0
- data/fixtures/fonts-app/source/fonts/StMarie-Thin.otf +0 -0
- data/fixtures/fonts-app/source/stylesheets/fonts.css.sass +3 -0
- data/fixtures/liquid-app/config.rb +0 -0
- data/fixtures/liquid-app/data/test.yml +4 -0
- data/fixtures/liquid-app/data/test2.json +4 -0
- data/fixtures/liquid-app/source/_liquid_partial.liquid +1 -0
- data/fixtures/liquid-app/source/data2.html.liquid +2 -0
- data/fixtures/liquid-app/source/liquid_master.html.liquid +1 -0
- data/fixtures/markdown-app/config.rb +9 -0
- data/fixtures/markdown-app/source/autolink.html.markdown +5 -0
- data/fixtures/markdown-app/source/fenced_code_blocks.html.markdown +7 -0
- data/fixtures/markdown-app/source/index.html.markdown +4 -0
- data/fixtures/markdown-app/source/no_intra_emphasis.html.markdown +5 -0
- data/fixtures/markdown-app/source/smarty_pants.html.markdown +5 -0
- data/fixtures/markdown-app/source/space_after_headers.html.markdown +5 -0
- data/fixtures/markdown-app/source/strikethrough.html.markdown +5 -0
- data/fixtures/markdown-app/source/superscript.html.markdown +5 -0
- data/fixtures/markdown-app/source/tables.html.markdown +8 -0
- data/fixtures/minify-css-app/config.rb +0 -0
- data/fixtures/minify-css-app/source/stylesheets/site.css.sass +1 -0
- data/fixtures/minify-js-app/config.rb +1 -0
- data/fixtures/minify-js-app/source/inline-coffeescript.html.haml +3 -0
- data/fixtures/minify-js-app/source/inline-js.html.haml +7 -0
- data/fixtures/minify-js-app/source/javascripts/coffee_test.js.coffee +3 -0
- data/fixtures/minify-js-app/source/javascripts/js_test.js +8 -0
- data/fixtures/passthrough-app/config.rb +17 -0
- data/fixtures/passthrough-app/source/.htaccess +1 -0
- data/fixtures/passthrough-app/source/inline-coffeescript.html.haml +3 -0
- data/fixtures/passthrough-app/source/inline-css.html.haml +4 -0
- data/fixtures/passthrough-app/source/inline-js.html.haml +7 -0
- data/fixtures/passthrough-app/source/javascripts/coffee_test.js.coffee +3 -0
- data/fixtures/passthrough-app/source/javascripts/js_test.js +8 -0
- data/fixtures/passthrough-app/source/stylesheets/site.css.sass +1 -0
- data/fixtures/preview-app/config.rb +0 -0
- data/fixtures/preview-app/source/content.html.erb +1 -0
- data/fixtures/preview-app/source/layout.erb +1 -0
- data/fixtures/preview-app/source/stylesheets/_partial.sass +2 -0
- data/fixtures/preview-app/source/stylesheets/_partial2.css.sass +2 -0
- data/fixtures/preview-app/source/stylesheets/main.css.sass +4 -0
- data/fixtures/preview-app/source/stylesheets/main2.css.sass +4 -0
- data/fixtures/preview-app/source/stylesheets/plain.css.sass +2 -0
- data/fixtures/relative-app/config.rb +0 -0
- data/fixtures/relative-app/source/images/blank.gif +0 -0
- data/fixtures/relative-app/source/stylesheets/relative_assets.css.sass +3 -0
- data/fixtures/relative-assets-app/config.rb +0 -0
- data/fixtures/relative-assets-app/source/images/blank.gif +0 -0
- data/fixtures/relative-assets-app/source/img/blank.gif +0 -0
- data/fixtures/relative-assets-app/source/relative_image.html.erb +1 -0
- data/fixtures/relative-assets-app/source/stylesheets/relative_assets.css.sass +3 -0
- data/fixtures/scss-app/config.rb +0 -0
- data/fixtures/scss-app/source/stylesheets/layout.css.sass +2 -0
- data/fixtures/scss-app/source/stylesheets/site_scss.css.scss +1 -0
- data/fixtures/slim-app/config.rb +1 -0
- data/fixtures/slim-app/source/slim.html.slim +7 -0
- data/fixtures/sprockets-app/config.rb +2 -0
- data/fixtures/sprockets-app/source/library/css/bootstrap_include.css.scss +1 -0
- data/fixtures/sprockets-app/source/library/css/plain.css +3 -0
- data/fixtures/sprockets-app/source/library/css/sprockets_base1.css.scss +1 -0
- data/fixtures/sprockets-app/source/library/css/sprockets_base2.css.scss +1 -0
- data/fixtures/sprockets-app/source/library/css/sprockets_sub.css.scss +1 -0
- data/fixtures/sprockets-app/source/library/js/jquery_include.js +1 -0
- data/fixtures/sprockets-app/source/library/js/plain.js +3 -0
- data/fixtures/sprockets-app/source/library/js/sprockets_base.js +5 -0
- data/fixtures/sprockets-app/source/library/js/sprockets_sub.js +3 -0
- data/fixtures/sprockets-app2/config.rb +0 -0
- data/fixtures/sprockets-app2/data/test.yml +4 -0
- data/fixtures/sprockets-app2/data/test2.json +4 -0
- data/fixtures/sprockets-app2/source/javascripts/multiple_engines.js.coffee.erb +1 -0
- data/fixtures/sprockets-app2/source/javascripts/sprockets_base.js +5 -0
- data/fixtures/sprockets-app2/source/javascripts/sprockets_sub.js +3 -0
- data/fixtures/sprockets-app2/source/stylesheets/sprockets_base1.css.scss +1 -0
- data/fixtures/sprockets-app2/source/stylesheets/sprockets_base2.css.scss +1 -0
- data/fixtures/sprockets-app2/source/stylesheets/sprockets_sub.css.scss +1 -0
- data/lib/middleman-more.rb +64 -0
- data/lib/middleman-more/core_extensions/compass.rb +75 -0
- data/lib/middleman-more/core_extensions/sprockets.rb +142 -0
- data/lib/middleman-more/extensions/cache_buster.rb +59 -0
- data/lib/middleman-more/extensions/minify_css.rb +17 -0
- data/lib/middleman-more/extensions/minify_css/cssmin.rb +55 -0
- data/lib/middleman-more/extensions/minify_javascript.rb +56 -0
- data/lib/middleman-more/extensions/relative_assets.rb +46 -0
- data/lib/middleman-more/renderers/haml.rb +13 -0
- data/lib/middleman-more/renderers/liquid.rb +21 -0
- data/lib/middleman-more/renderers/markdown.rb +28 -0
- data/lib/middleman-more/renderers/sass.rb +53 -0
- data/lib/middleman-more/renderers/slim.rb +15 -0
- data/middleman-more.gemspec +32 -0
- metadata +468 -0
data/Rakefile
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Feature: Generate mtime-based query string for busting browser caches
|
|
2
|
+
In order to display the most recent content for IE & CDNs and appease YSlow
|
|
3
|
+
|
|
4
|
+
Scenario: Rendering css with the feature disabled
|
|
5
|
+
Given "cache_buster" feature is "disabled"
|
|
6
|
+
And the Server is running at "cache-buster-app"
|
|
7
|
+
When I go to "/stylesheets/relative_assets.css"
|
|
8
|
+
Then I should not see "?"
|
|
9
|
+
|
|
10
|
+
Scenario: Rendering html with the feature disabled
|
|
11
|
+
Given "cache_buster" feature is "disabled"
|
|
12
|
+
And the Server is running at "cache-buster-app"
|
|
13
|
+
When I go to "/cache-buster.html"
|
|
14
|
+
Then I should not see "?"
|
|
15
|
+
|
|
16
|
+
Scenario: Rendering css with the feature enabled
|
|
17
|
+
Given "cache_buster" feature is "enabled"
|
|
18
|
+
And the Server is running at "cache-buster-app"
|
|
19
|
+
When I go to "/stylesheets/relative_assets.css"
|
|
20
|
+
Then I should see "?"
|
|
21
|
+
|
|
22
|
+
Scenario: Rendering html with the feature enabled
|
|
23
|
+
Given "cache_buster" feature is "enabled"
|
|
24
|
+
And the Server is running at "cache-buster-app"
|
|
25
|
+
When I go to "/cache-buster.html"
|
|
26
|
+
Then I should see "?"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Feature: Support coffee-script
|
|
2
|
+
In order to offer an alternative when writing Javascript
|
|
3
|
+
|
|
4
|
+
Scenario: Rendering coffee script
|
|
5
|
+
Given the Server is running at "coffeescript-app"
|
|
6
|
+
When I go to "/javascripts/coffee_test.js"
|
|
7
|
+
Then I should see "Array.prototype.slice"
|
|
8
|
+
|
|
9
|
+
Scenario: Rendering coffee-script with :coffeescript haml-filter
|
|
10
|
+
Given the Server is running at "coffeescript-app"
|
|
11
|
+
When I go to "/inline-coffeescript.html"
|
|
12
|
+
Then I should see "Array.prototype.slice"
|
|
13
|
+
|
|
14
|
+
Scenario: Rendering broken coffee
|
|
15
|
+
Given the Server is running at "coffeescript-app"
|
|
16
|
+
When I go to "/javascripts/broken-coffee.js"
|
|
17
|
+
Then I should see "Error"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Feature: Support content_for and yield_content helpers
|
|
2
|
+
|
|
3
|
+
Scenario: content_for works as expected in haml
|
|
4
|
+
Given the Server is running at "content-for-app"
|
|
5
|
+
When I go to "/content_for_haml.html"
|
|
6
|
+
Then I should see "In Layout: I am the yielded content haml"
|
|
7
|
+
|
|
8
|
+
Scenario: content_for works as expected in slim
|
|
9
|
+
Given the Server is running at "content-for-app"
|
|
10
|
+
When I go to "/content_for_slim.html"
|
|
11
|
+
Then I should see "In Layout: I am the yielded content slim"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Feature: Web Fonts
|
|
2
|
+
|
|
3
|
+
Scenario: Checking built folder for content
|
|
4
|
+
Given a successfully built app at "fonts-app"
|
|
5
|
+
When I cd to "build"
|
|
6
|
+
Then the following files should exist:
|
|
7
|
+
| stylesheets/fonts.css |
|
|
8
|
+
And the file "stylesheets/fonts.css" should contain "/fonts/StMarie-Thin.otf"
|
|
9
|
+
|
|
10
|
+
Scenario: Rendering scss
|
|
11
|
+
Given the Server is running at "fonts-app"
|
|
12
|
+
When I go to "/stylesheets/fonts.css"
|
|
13
|
+
Then I should see "/fonts/StMarie-Thin.otf"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Feature: CSS and Javascripts which are minify shouldn't be re-minified
|
|
2
|
+
Scenario: CSS file
|
|
3
|
+
|
|
4
|
+
Scenario: JS files containing ".min" should not be re-compressed
|
|
5
|
+
And the Server is running at "already-minified-app"
|
|
6
|
+
When I go to "/javascripts/test.min.js"
|
|
7
|
+
Then I should see "10" lines
|
|
8
|
+
|
|
9
|
+
Scenario: CSS files containing ".min" should not be re-compressed
|
|
10
|
+
And the Server is running at "already-minified-app"
|
|
11
|
+
When I go to "/stylesheets/test.min.css"
|
|
12
|
+
Then I should see "10" lines
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Feature: Support liquid partials
|
|
2
|
+
|
|
3
|
+
Scenario: Rendering liquid
|
|
4
|
+
Given the Server is running at "liquid-app"
|
|
5
|
+
When I go to "/liquid_master.html"
|
|
6
|
+
Then I should see "Greetings"
|
|
7
|
+
|
|
8
|
+
Scenario: Rendering liquid
|
|
9
|
+
Given the Server is running at "liquid-app"
|
|
10
|
+
When I go to "/data2.html"
|
|
11
|
+
Then I should see "OneTwo"
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Feature: Markdown support
|
|
2
|
+
In order to test included Maruku support
|
|
3
|
+
|
|
4
|
+
Scenario: Rendering html
|
|
5
|
+
Given the Server is running at "markdown-app"
|
|
6
|
+
When I go to "/index.html"
|
|
7
|
+
Then I should see "<p>Hello World</p>"
|
|
8
|
+
|
|
9
|
+
Scenario: Redcarpet 2 extensions
|
|
10
|
+
Given the Server is running at "markdown-app"
|
|
11
|
+
When I go to "/smarty_pants.html"
|
|
12
|
+
Then I should see "“"
|
|
13
|
+
When I go to "/no_intra_emphasis.html"
|
|
14
|
+
Then I should not see "<em>"
|
|
15
|
+
When I go to "/tables.html"
|
|
16
|
+
Then I should see "<table>"
|
|
17
|
+
When I go to "/fenced_code_blocks.html"
|
|
18
|
+
Then I should see "<code>"
|
|
19
|
+
When I go to "/autolink.html"
|
|
20
|
+
Then I should see "<a href"
|
|
21
|
+
When I go to "/strikethrough.html"
|
|
22
|
+
Then I should see "<del>"
|
|
23
|
+
When I go to "/space_after_headers.html"
|
|
24
|
+
Then I should not see "<h1>"
|
|
25
|
+
When I go to "/superscript.html"
|
|
26
|
+
Then I should see "<sup>"
|
|
27
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Feature: Minify CSS
|
|
2
|
+
In order reduce bytes sent to client and appease YSlow
|
|
3
|
+
|
|
4
|
+
Scenario: Rendering external css with the feature disabled
|
|
5
|
+
Given "minify_css" feature is "disabled"
|
|
6
|
+
And the Server is running at "minify-css-app"
|
|
7
|
+
When I go to "/stylesheets/site.css"
|
|
8
|
+
Then I should see "55" lines
|
|
9
|
+
|
|
10
|
+
Scenario: Rendering external css with the feature enabled
|
|
11
|
+
Given "minify_css" feature is "enabled"
|
|
12
|
+
And the Server is running at "minify-css-app"
|
|
13
|
+
When I go to "/stylesheets/site.css"
|
|
14
|
+
Then I should see "1" lines
|
|
15
|
+
|
|
16
|
+
Scenario: Rendering external css with passthrough compressor
|
|
17
|
+
Given the Server is running at "passthrough-app"
|
|
18
|
+
When I go to "/stylesheets/site.css"
|
|
19
|
+
Then I should see "55" lines
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
Feature: Minify Javascript
|
|
2
|
+
In order reduce bytes sent to client and appease YSlow
|
|
3
|
+
|
|
4
|
+
Background:
|
|
5
|
+
Given current environment is "build"
|
|
6
|
+
|
|
7
|
+
Scenario: Rendering inline js with the feature disabled
|
|
8
|
+
Given "minify_javascript" feature is "disabled"
|
|
9
|
+
And the Server is running at "minify-js-app"
|
|
10
|
+
When I go to "/inline-js.html"
|
|
11
|
+
Then I should see "10" lines
|
|
12
|
+
|
|
13
|
+
Scenario: Rendering inline js with a passthrough minifier
|
|
14
|
+
Given the Server is running at "passthrough-app"
|
|
15
|
+
When I go to "/inline-js.html"
|
|
16
|
+
Then I should see "11" lines
|
|
17
|
+
|
|
18
|
+
Scenario: Rendering inline js with the feature enabled
|
|
19
|
+
Given "minify_javascript" feature is "enabled"
|
|
20
|
+
And the Server is running at "minify-js-app"
|
|
21
|
+
When I go to "/inline-js.html"
|
|
22
|
+
Then I should see "5" lines
|
|
23
|
+
|
|
24
|
+
Scenario: Rendering external js with the feature enabled
|
|
25
|
+
Given "minify_javascript" feature is "enabled"
|
|
26
|
+
And the Server is running at "minify-js-app"
|
|
27
|
+
When I go to "/javascripts/js_test.js"
|
|
28
|
+
Then I should see "1" lines
|
|
29
|
+
|
|
30
|
+
Scenario: Rendering external js with a passthrough minifier
|
|
31
|
+
And the Server is running at "passthrough-app"
|
|
32
|
+
When I go to "/javascripts/js_test.js"
|
|
33
|
+
Then I should see "8" lines
|
|
34
|
+
|
|
35
|
+
Scenario: Rendering inline js (coffeescript) with the feature enabled
|
|
36
|
+
Given "minify_javascript" feature is "enabled"
|
|
37
|
+
And the Server is running at "minify-js-app"
|
|
38
|
+
When I go to "/inline-coffeescript.html"
|
|
39
|
+
Then I should see "5" lines
|
|
40
|
+
|
|
41
|
+
Scenario: Rendering external js (coffeescript) with the feature enabled
|
|
42
|
+
Given "minify_javascript" feature is "enabled"
|
|
43
|
+
And the Server is running at "minify-js-app"
|
|
44
|
+
When I go to "/javascripts/coffee_test.js"
|
|
45
|
+
Then I should see "1" lines
|
|
46
|
+
|
|
47
|
+
Scenario: Rendering inline js (coffeescript) with a passthrough minifier
|
|
48
|
+
Given the Server is running at "passthrough-app"
|
|
49
|
+
When I go to "/inline-coffeescript.html"
|
|
50
|
+
Then I should see "17" lines
|
|
51
|
+
|
|
52
|
+
Scenario: Rendering external js (coffeescript) with a passthrough minifier
|
|
53
|
+
And the Server is running at "passthrough-app"
|
|
54
|
+
When I go to "/javascripts/coffee_test.js"
|
|
55
|
+
Then I should see "11" lines
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
Feature: Relative Assets
|
|
2
|
+
In order easily switch between relative and absolute paths
|
|
3
|
+
|
|
4
|
+
Scenario: Rendering css with the feature disabled
|
|
5
|
+
Given "relative_assets" feature is "disabled"
|
|
6
|
+
And the Server is running at "relative-assets-app"
|
|
7
|
+
When I go to "/stylesheets/relative_assets.css"
|
|
8
|
+
Then I should not see "url('../"
|
|
9
|
+
And I should see "/images/blank.gif"
|
|
10
|
+
|
|
11
|
+
Scenario: Rendering html with the feature disabled
|
|
12
|
+
Given "relative_assets" feature is "disabled"
|
|
13
|
+
And the Server is running at "relative-assets-app"
|
|
14
|
+
When I go to "/relative_image.html"
|
|
15
|
+
Then I should see "/images/blank.gif"
|
|
16
|
+
|
|
17
|
+
Scenario: Rendering css with the feature enabled
|
|
18
|
+
Given "relative_assets" feature is "enabled"
|
|
19
|
+
And the Server is running at "relative-assets-app"
|
|
20
|
+
When I go to "/stylesheets/relative_assets.css"
|
|
21
|
+
Then I should see "url('../images/blank.gif"
|
|
22
|
+
|
|
23
|
+
Scenario: Rendering html with the feature enabled
|
|
24
|
+
Given "relative_assets" feature is "enabled"
|
|
25
|
+
And the Server is running at "relative-assets-app"
|
|
26
|
+
When I go to "/relative_image.html"
|
|
27
|
+
Then I should not see "/images/blank.gif"
|
|
28
|
+
And I should see "images/blank.gif"
|
|
29
|
+
|
|
30
|
+
Scenario: Rendering html with a custom images_dir
|
|
31
|
+
Given "relative_assets" feature is "enabled"
|
|
32
|
+
And "images_dir" is set to "img"
|
|
33
|
+
And the Server is running at "relative-assets-app"
|
|
34
|
+
When I go to "/stylesheets/relative_assets.css"
|
|
35
|
+
Then I should see "url('../img/blank.gif"
|
|
36
|
+
|
|
37
|
+
Scenario: Rendering css with a custom images_dir
|
|
38
|
+
Given "relative_assets" feature is "enabled"
|
|
39
|
+
And "images_dir" is set to "img"
|
|
40
|
+
And the Server is running at "relative-assets-app"
|
|
41
|
+
When I go to "/relative_image.html"
|
|
42
|
+
Then I should not see "/images/blank.gif"
|
|
43
|
+
Then I should not see "/img/blank.gif"
|
|
44
|
+
And I should see "img/blank.gif"
|
|
45
|
+
|
|
46
|
+
Scenario: Rendering scss with the feature enabled
|
|
47
|
+
Given "relative_assets" feature is "enabled"
|
|
48
|
+
And the Server is running at "fonts-app"
|
|
49
|
+
When I go to "/stylesheets/fonts.css"
|
|
50
|
+
Then I should see "url('../fonts/StMarie"
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
Feature: Sass Updates and Partials
|
|
2
|
+
Scenario: The preview server should update stylesheets when Sass changes
|
|
3
|
+
Given the Server is running at "preview-app"
|
|
4
|
+
And the file "source/stylesheets/plain.css.sass" has the contents
|
|
5
|
+
"""
|
|
6
|
+
red
|
|
7
|
+
color: red
|
|
8
|
+
"""
|
|
9
|
+
When I go to "/stylesheets/plain.css"
|
|
10
|
+
Then I should see "color: red;"
|
|
11
|
+
And the file "source/stylesheets/plain.css.sass" has the contents
|
|
12
|
+
"""
|
|
13
|
+
red
|
|
14
|
+
color: blue
|
|
15
|
+
"""
|
|
16
|
+
When I go to "/stylesheets/plain.css"
|
|
17
|
+
Then I should see "color: blue;"
|
|
18
|
+
|
|
19
|
+
Scenario: The preview server should update stylesheets when Sass partials change
|
|
20
|
+
Given the Server is running at "preview-app"
|
|
21
|
+
And the file "source/stylesheets/main.css.sass" has the contents
|
|
22
|
+
"""
|
|
23
|
+
@import partial.sass
|
|
24
|
+
|
|
25
|
+
red
|
|
26
|
+
color: red
|
|
27
|
+
"""
|
|
28
|
+
And the file "source/stylesheets/_partial.sass" has the contents
|
|
29
|
+
"""
|
|
30
|
+
body
|
|
31
|
+
font-size: 14px
|
|
32
|
+
"""
|
|
33
|
+
When I go to "/stylesheets/main.css"
|
|
34
|
+
Then I should see "color: red;"
|
|
35
|
+
And I should see "font-size: 14px;"
|
|
36
|
+
And the file "source/stylesheets/main.css.sass" has the contents
|
|
37
|
+
"""
|
|
38
|
+
@import partial.sass
|
|
39
|
+
|
|
40
|
+
red
|
|
41
|
+
color: blue
|
|
42
|
+
"""
|
|
43
|
+
And the file "source/stylesheets/_partial.sass" has the contents
|
|
44
|
+
"""
|
|
45
|
+
body
|
|
46
|
+
font-size: 18px
|
|
47
|
+
"""
|
|
48
|
+
When I go to "/stylesheets/main.css"
|
|
49
|
+
Then I should see "color: blue;"
|
|
50
|
+
And I should see "font-size: 18px"
|
|
51
|
+
|
|
52
|
+
Scenario: The preview server should update stylesheets when Sprockets partials change
|
|
53
|
+
Given the Server is running at "preview-app"
|
|
54
|
+
And the file "source/stylesheets/main2.css.sass" has the contents
|
|
55
|
+
"""
|
|
56
|
+
//= require "_partial2.css.sass"
|
|
57
|
+
|
|
58
|
+
red
|
|
59
|
+
color: red
|
|
60
|
+
"""
|
|
61
|
+
And the file "source/stylesheets/_partial2.css.sass" has the contents
|
|
62
|
+
"""
|
|
63
|
+
body
|
|
64
|
+
font-size: 14px
|
|
65
|
+
"""
|
|
66
|
+
When I go to "/stylesheets/main2.css"
|
|
67
|
+
Then I should see "color: red;"
|
|
68
|
+
Then I should see "font-size: 14px"
|
|
69
|
+
And the file "source/stylesheets/main2.css.sass" has the contents
|
|
70
|
+
"""
|
|
71
|
+
//= require "_partial2.css.sass"
|
|
72
|
+
|
|
73
|
+
red
|
|
74
|
+
color: blue
|
|
75
|
+
"""
|
|
76
|
+
And the file "source/stylesheets/_partial2.css.sass" has the contents
|
|
77
|
+
"""
|
|
78
|
+
body
|
|
79
|
+
font-size: 18px
|
|
80
|
+
"""
|
|
81
|
+
When I go to "/stylesheets/main2.css"
|
|
82
|
+
Then I should see "color: blue;"
|
|
83
|
+
Then I should see "font-size: 18px"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Feature: Support SCSS Syntax
|
|
2
|
+
In order to offer an alternative when writing Sass
|
|
3
|
+
|
|
4
|
+
Scenario: Rendering scss
|
|
5
|
+
Given the Server is running at "scss-app"
|
|
6
|
+
When I go to "/stylesheets/site_scss.css"
|
|
7
|
+
Then I should see "html"
|
|
8
|
+
|
|
9
|
+
Scenario: Rendering scss
|
|
10
|
+
Given the Server is running at "scss-app"
|
|
11
|
+
When I go to "/stylesheets/layout.css"
|
|
12
|
+
Then I should see "html"
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
Feature: Sprockets
|
|
2
|
+
|
|
3
|
+
Scenario: Sprockets JS require
|
|
4
|
+
Given the Server is running at "sprockets-app2"
|
|
5
|
+
When I go to "/javascripts/sprockets_base.js"
|
|
6
|
+
Then I should see "sprockets_sub_function"
|
|
7
|
+
|
|
8
|
+
Scenario: Sprockets JS require with custom :js_dir
|
|
9
|
+
Given the Server is running at "sprockets-app"
|
|
10
|
+
When I go to "/library/js/sprockets_base.js"
|
|
11
|
+
Then I should see "sprockets_sub_function"
|
|
12
|
+
|
|
13
|
+
Scenario: Plain JS require with custom :js_dir
|
|
14
|
+
Given the Server is running at "sprockets-app"
|
|
15
|
+
When I go to "/library/css/plain.css"
|
|
16
|
+
Then I should see "helloWorld"
|
|
17
|
+
|
|
18
|
+
Scenario: Sprockets JS should have access to yaml data
|
|
19
|
+
Given the Server is running at "sprockets-app2"
|
|
20
|
+
When I go to "/javascripts/multiple_engines.js"
|
|
21
|
+
Then I should see "Hello One"
|
|
22
|
+
|
|
23
|
+
Scenario: Multiple engine files should build correctly
|
|
24
|
+
Given a successfully built app at "sprockets-app2"
|
|
25
|
+
When I cd to "build"
|
|
26
|
+
Then a file named "javascripts/multiple_engines.js" should exist
|
|
27
|
+
And the file "javascripts/multiple_engines.js" should contain "Hello One"
|
|
28
|
+
|
|
29
|
+
Scenario: Sprockets CSS require //require
|
|
30
|
+
Given the Server is running at "sprockets-app2"
|
|
31
|
+
When I go to "/stylesheets/sprockets_base1.css"
|
|
32
|
+
Then I should see "hello"
|
|
33
|
+
|
|
34
|
+
Scenario: Sprockets CSS require @import
|
|
35
|
+
Given the Server is running at "sprockets-app2"
|
|
36
|
+
When I go to "/stylesheets/sprockets_base2.css"
|
|
37
|
+
Then I should see "hello"
|
|
38
|
+
|
|
39
|
+
Scenario: Sprockets CSS require with custom :css_dir //require
|
|
40
|
+
Given the Server is running at "sprockets-app"
|
|
41
|
+
When I go to "/library/css/sprockets_base1.css"
|
|
42
|
+
Then I should see "hello"
|
|
43
|
+
|
|
44
|
+
Scenario: Plain CSS require with custom :css_dir
|
|
45
|
+
Given the Server is running at "sprockets-app"
|
|
46
|
+
When I go to "/library/css/plain.css"
|
|
47
|
+
Then I should see "helloWorld"
|
|
48
|
+
|
|
49
|
+
Scenario: Sprockets CSS require with custom :css_dir @import
|
|
50
|
+
Given the Server is running at "sprockets-app"
|
|
51
|
+
When I go to "/library/css/sprockets_base2.css"
|
|
52
|
+
Then I should see "hello"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Feature: Sprockets Gems
|
|
2
|
+
Scenario: Sprockets can pull jQuery from gem
|
|
3
|
+
Given the Server is running at "sprockets-app"
|
|
4
|
+
When I go to "/library/js/jquery_include.js"
|
|
5
|
+
Then I should see "var jQuery ="
|
|
6
|
+
|
|
7
|
+
# Scenario: Sprockets can pull CSS from gem
|
|
8
|
+
# Given the Server is running at "sprockets-app"
|
|
9
|
+
# When I go to "/library/css/bootstrap_include.css"
|
|
10
|
+
# Then I should see "Bootstrap"
|