middleman 2.0.9.pre-x86-mswin32
Sign up to get free protection for your applications and to get access to all the features.
- data/.gemtest +0 -0
- data/.gitignore +13 -0
- data/.travis.yml +4 -0
- data/CHANGELOG +47 -0
- data/Gemfile +3 -0
- data/LICENSE +20 -0
- data/README.md +19 -0
- data/Rakefile +15 -0
- data/bin/middleman +73 -0
- data/bin/mm-build +9 -0
- data/bin/mm-init +9 -0
- data/bin/mm-server +9 -0
- data/features/asset_host.feature +14 -0
- data/features/automatic_image_sizes.feature +16 -0
- data/features/builder.feature +23 -0
- data/features/cache_buster.feature +26 -0
- data/features/coffee-script.feature +17 -0
- data/features/data.feature +12 -0
- data/features/directory_index.feature +29 -0
- data/features/dynamic_pages.feature +33 -0
- data/features/front-matter.feature +7 -0
- data/features/generator.feature +8 -0
- data/features/helpers_auto_javascript_include_tag.feature +27 -0
- data/features/helpers_auto_stylesheet_link_tag.feature +27 -0
- data/features/helpers_page_classes.feature +17 -0
- data/features/liquid.feature +6 -0
- data/features/markdown.feature +7 -0
- data/features/minify_css.feature +24 -0
- data/features/minify_javascript.feature +23 -0
- data/features/padrino_helpers.feature +10 -0
- data/features/page_alias_and_layouts.feature +44 -0
- data/features/relative_assets.feature +44 -0
- data/features/scss-support.feature +12 -0
- data/features/sinatra.feature +6 -0
- data/features/slim.feature +7 -0
- data/features/sprockets.feature +21 -0
- data/features/sprockets_gems.feature +7 -0
- data/features/step_definitions/asset_host_steps.rb +8 -0
- data/features/step_definitions/builder_steps.rb +40 -0
- data/features/step_definitions/generator_steps.rb +30 -0
- data/features/step_definitions/middleman_steps.rb +46 -0
- data/features/step_definitions/page_layout_steps.rb +13 -0
- data/features/support/env.rb +3 -0
- data/features/tiny_src.feature +15 -0
- data/fixtures/indexable-app/config.rb +2 -0
- data/fixtures/indexable-app/source/a_folder/needs_index.html +1 -0
- data/fixtures/indexable-app/source/leave_me_alone.html +1 -0
- data/fixtures/indexable-app/source/needs_index.html +1 -0
- data/fixtures/indexable-app/source/regular/index.html +1 -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/sprockets-app/config.rb +1 -0
- data/fixtures/sprockets-app/source/jquery_include.js +1 -0
- data/fixtures/sprockets-app/source/library/javascripts/sprockets_base.js +5 -0
- data/fixtures/sprockets-app/source/library/javascripts/sprockets_sub.js +3 -0
- data/fixtures/test-app/config.rb +51 -0
- data/fixtures/test-app/data/test.yml +4 -0
- data/fixtures/test-app/source/_liquid_partial.liquid +1 -0
- data/fixtures/test-app/source/_partial.haml +1 -0
- data/fixtures/test-app/source/a_folder/needs_index.html +1 -0
- data/fixtures/test-app/source/asset_host.html.haml +1 -0
- data/fixtures/test-app/source/auto-css.html.haml +1 -0
- data/fixtures/test-app/source/auto-css/auto-css.html.haml +1 -0
- data/fixtures/test-app/source/auto-css/index.html.haml +1 -0
- data/fixtures/test-app/source/auto-css/sub/auto-css.html.haml +1 -0
- data/fixtures/test-app/source/auto-image-sizes.html.haml +1 -0
- data/fixtures/test-app/source/auto-js.html.haml +1 -0
- data/fixtures/test-app/source/auto-js/auto-js.html.haml +1 -0
- data/fixtures/test-app/source/auto-js/index.html.haml +1 -0
- data/fixtures/test-app/source/auto-js/sub/auto-js.html.haml +1 -0
- data/fixtures/test-app/source/cache-buster.html.haml +2 -0
- data/fixtures/test-app/source/custom-layout-dir/index.html.haml +1 -0
- data/fixtures/test-app/source/custom-layout.html.haml +1 -0
- data/fixtures/test-app/source/data.html.erb +1 -0
- data/fixtures/test-app/source/data2.html.liquid +2 -0
- data/fixtures/test-app/source/front-matter.html.erb +6 -0
- data/fixtures/test-app/source/images/Child folder/regular_file(example).txt +1 -0
- data/fixtures/test-app/source/images/Read me (example).txt +1 -0
- data/fixtures/test-app/source/images/blank.gif +0 -0
- data/fixtures/test-app/source/img/blank.gif +0 -0
- data/fixtures/test-app/source/index.html.haml +6 -0
- data/fixtures/test-app/source/inline-coffeescript.html.haml +3 -0
- data/fixtures/test-app/source/inline-css.html.haml +4 -0
- data/fixtures/test-app/source/inline-js.html.haml +7 -0
- data/fixtures/test-app/source/javascripts/auto-js.js +1 -0
- data/fixtures/test-app/source/javascripts/auto-js/auto-js.js +1 -0
- data/fixtures/test-app/source/javascripts/auto-js/index.js +1 -0
- data/fixtures/test-app/source/javascripts/auto-js/sub/auto-js.js +1 -0
- data/fixtures/test-app/source/javascripts/broken-coffee.js.coffee +3 -0
- data/fixtures/test-app/source/javascripts/coffee_test.js.coffee +3 -0
- data/fixtures/test-app/source/javascripts/jquery.plugin.with.dots.js +1 -0
- data/fixtures/test-app/source/javascripts/jquery_base.js +5 -0
- data/fixtures/test-app/source/javascripts/multiple_engines.js.coffee.erb +1 -0
- data/fixtures/test-app/source/javascripts/sprockets_base.js +5 -0
- data/fixtures/test-app/source/javascripts/sprockets_sub.js +3 -0
- data/fixtures/test-app/source/layout.haml +6 -0
- data/fixtures/test-app/source/layouts/custom.haml +5 -0
- data/fixtures/test-app/source/liquid_master.html.liquid +1 -0
- data/fixtures/test-app/source/markdown.html.markdown +1 -0
- data/fixtures/test-app/source/needs_index.html +1 -0
- data/fixtures/test-app/source/padrino_test.html.haml +5 -0
- data/fixtures/test-app/source/page-classes.html.haml +1 -0
- data/fixtures/test-app/source/real.html +1 -0
- data/fixtures/test-app/source/real/index.html.erb +5 -0
- data/fixtures/test-app/source/relative_image.html.erb +1 -0
- data/fixtures/test-app/source/services/index.html.haml +1 -0
- data/fixtures/test-app/source/should_be_ignored.html +1 -0
- data/fixtures/test-app/source/should_be_ignored2.html +1 -0
- data/fixtures/test-app/source/should_be_ignored3.html +1 -0
- data/fixtures/test-app/source/slim.html.slim +7 -0
- data/fixtures/test-app/source/spaces in file.html.erb +1 -0
- data/fixtures/test-app/source/static.html +1 -0
- data/fixtures/test-app/source/stylesheets/asset_host.css.sass +3 -0
- data/fixtures/test-app/source/stylesheets/auto-css.css +3 -0
- data/fixtures/test-app/source/stylesheets/auto-css/auto-css.css +3 -0
- data/fixtures/test-app/source/stylesheets/auto-css/index.css +0 -0
- data/fixtures/test-app/source/stylesheets/auto-css/sub/auto-css.css +3 -0
- data/fixtures/test-app/source/stylesheets/layout.css.sass +2 -0
- data/fixtures/test-app/source/stylesheets/relative_assets.css.sass +3 -0
- data/fixtures/test-app/source/stylesheets/site.css.sass +1 -0
- data/fixtures/test-app/source/stylesheets/site_scss.css.scss +1 -0
- data/fixtures/test-app/source/stylesheets/static.css +2 -0
- data/fixtures/test-app/source/sub1/page-classes.html.haml +1 -0
- data/fixtures/test-app/source/sub1/sub2/page-classes.html.haml +1 -0
- data/fixtures/test-app/source/tiny_src.html.haml +1 -0
- data/lib/middleman.rb +202 -0
- data/lib/middleman/base.rb +198 -0
- data/lib/middleman/builder.rb +163 -0
- data/lib/middleman/cli.rb +87 -0
- data/lib/middleman/config.ru +2 -0
- data/lib/middleman/core_extensions/assets.rb +57 -0
- data/lib/middleman/core_extensions/builder.rb +41 -0
- data/lib/middleman/core_extensions/compass.rb +102 -0
- data/lib/middleman/core_extensions/data.rb +120 -0
- data/lib/middleman/core_extensions/default_helpers.rb +77 -0
- data/lib/middleman/core_extensions/features.rb +102 -0
- data/lib/middleman/core_extensions/front_matter.rb +116 -0
- data/lib/middleman/core_extensions/rack_map.rb +35 -0
- data/lib/middleman/core_extensions/rendering.rb +19 -0
- data/lib/middleman/core_extensions/routing.rb +87 -0
- data/lib/middleman/core_extensions/sprockets.rb +102 -0
- data/lib/middleman/features/asset_host.rb +22 -0
- data/lib/middleman/features/automatic_image_sizes.rb +31 -0
- data/lib/middleman/features/automatic_image_sizes/fastimage.rb +287 -0
- data/lib/middleman/features/cache_buster.rb +42 -0
- data/lib/middleman/features/directory_indexes.rb +56 -0
- data/lib/middleman/features/lorem.rb +126 -0
- data/lib/middleman/features/minify_css.rb +10 -0
- data/lib/middleman/features/minify_javascript.rb +43 -0
- data/lib/middleman/features/relative_assets.rb +38 -0
- data/lib/middleman/features/tiny_src.rb +11 -0
- data/lib/middleman/guard.rb +71 -0
- data/lib/middleman/renderers/coffee_script.rb +8 -0
- data/lib/middleman/renderers/haml.rb +31 -0
- data/lib/middleman/renderers/liquid.rb +29 -0
- data/lib/middleman/renderers/markdown.rb +34 -0
- data/lib/middleman/renderers/sass.rb +63 -0
- data/lib/middleman/renderers/slim.rb +8 -0
- data/lib/middleman/templates.rb +53 -0
- data/lib/middleman/templates/default.rb +17 -0
- data/lib/middleman/templates/default/source/index.html.erb +5 -0
- data/lib/middleman/templates/default/source/layout.erb +19 -0
- data/lib/middleman/templates/default/source/stylesheets/site.css.scss +32 -0
- data/lib/middleman/templates/html5.rb +16 -0
- data/lib/middleman/templates/html5/source/404.html +38 -0
- data/lib/middleman/templates/html5/source/README.md +388 -0
- data/lib/middleman/templates/html5/source/apple-touch-icon-114x114-precomposed.png +0 -0
- data/lib/middleman/templates/html5/source/apple-touch-icon-57x57-precomposed.png +0 -0
- data/lib/middleman/templates/html5/source/apple-touch-icon-72x72-precomposed.png +0 -0
- data/lib/middleman/templates/html5/source/apple-touch-icon-precomposed.png +0 -0
- data/lib/middleman/templates/html5/source/apple-touch-icon.png +0 -0
- data/lib/middleman/templates/html5/source/crossdomain.xml +25 -0
- data/lib/middleman/templates/html5/source/css/style.css +293 -0
- data/lib/middleman/templates/html5/source/favicon.ico +0 -0
- data/lib/middleman/templates/html5/source/humans.txt +43 -0
- data/lib/middleman/templates/html5/source/img/.gitignore +2 -0
- data/lib/middleman/templates/html5/source/index.html +79 -0
- data/lib/middleman/templates/html5/source/js/libs/jquery-1.6.2.js +8981 -0
- data/lib/middleman/templates/html5/source/js/libs/jquery-1.6.2.min.js +18 -0
- data/lib/middleman/templates/html5/source/js/libs/modernizr-2.0.6.min.js +4 -0
- data/lib/middleman/templates/html5/source/js/mylibs/.gitignore +2 -0
- data/lib/middleman/templates/html5/source/js/plugins.js +20 -0
- data/lib/middleman/templates/html5/source/js/script.js +8 -0
- data/lib/middleman/templates/html5/source/robots.txt +5 -0
- data/lib/middleman/templates/html5/source/test/index.html +31 -0
- data/lib/middleman/templates/html5/source/test/qunit/qunit.css +148 -0
- data/lib/middleman/templates/html5/source/test/qunit/qunit.js +1265 -0
- data/lib/middleman/templates/html5/source/test/tests.js +24 -0
- data/lib/middleman/templates/local.rb +20 -0
- data/lib/middleman/templates/shared/Gemfile.tt +3 -0
- data/lib/middleman/templates/shared/config.ru +4 -0
- data/lib/middleman/templates/shared/config.tt +104 -0
- data/lib/middleman/version.rb +3 -0
- data/middleman.gemspec +79 -0
- metadata +826 -0
@@ -0,0 +1,27 @@
|
|
1
|
+
Feature: Built-in auto_stylesheet_link_tag view helper
|
2
|
+
In order to simplify including css files
|
3
|
+
|
4
|
+
Scenario: Viewing the root path
|
5
|
+
Given the Server is running at "test-app"
|
6
|
+
When I go to "/auto-css.html"
|
7
|
+
Then I should see "stylesheets/auto-css.css"
|
8
|
+
|
9
|
+
Scenario: Viewing a tier-1 path
|
10
|
+
Given the Server is running at "test-app"
|
11
|
+
When I go to "/auto-css/auto-css.html"
|
12
|
+
Then I should see "stylesheets/auto-css/auto-css.css"
|
13
|
+
|
14
|
+
Scenario: Viewing the index file of a tier-1 path, without filename
|
15
|
+
Given the Server is running at "test-app"
|
16
|
+
When I go to "/auto-css"
|
17
|
+
Then I should see "stylesheets/auto-css/index.css"
|
18
|
+
|
19
|
+
Scenario: Viewing the index file of a tier-1 path, without filename, with a trailing slash
|
20
|
+
Given the Server is running at "test-app"
|
21
|
+
When I go to "/auto-css/"
|
22
|
+
Then I should see "stylesheets/auto-css/index.css"
|
23
|
+
|
24
|
+
Scenario: Viewing a tier-2 path
|
25
|
+
Given the Server is running at "test-app"
|
26
|
+
When I go to "/auto-css/sub/auto-css.html"
|
27
|
+
Then I should see "stylesheets/auto-css/sub/auto-css.css"
|
@@ -0,0 +1,17 @@
|
|
1
|
+
Feature: Built-in page_classes view helper
|
2
|
+
In order to generate body classes for views
|
3
|
+
|
4
|
+
Scenario: Viewing the root path
|
5
|
+
Given the Server is running at "test-app"
|
6
|
+
When I go to "/page-classes.html"
|
7
|
+
Then I should see "page-classes"
|
8
|
+
|
9
|
+
Scenario: Viewing a tier-1 path
|
10
|
+
Given the Server is running at "test-app"
|
11
|
+
When I go to "/sub1/page-classes.html"
|
12
|
+
Then I should see "sub1 sub1_page-classes"
|
13
|
+
|
14
|
+
Scenario: Viewing a tier-2 path
|
15
|
+
Given the Server is running at "test-app"
|
16
|
+
When I go to "/sub1/sub2/page-classes.html"
|
17
|
+
Then I should see "sub1 sub1_sub2 sub1_sub2_page-classes"
|
@@ -0,0 +1,24 @@
|
|
1
|
+
Feature: Minify CSS
|
2
|
+
In order reduce bytes sent to client and appease YSlow
|
3
|
+
|
4
|
+
# Scenario: Rendering inline css with the feature disabled
|
5
|
+
# Given "minify_css" feature is "disabled"
|
6
|
+
# When I go to "/inline-css.html"
|
7
|
+
# Then I should see "4" lines
|
8
|
+
|
9
|
+
Scenario: Rendering external css with the feature disabled
|
10
|
+
Given "minify_css" feature is "disabled"
|
11
|
+
And the Server is running at "test-app"
|
12
|
+
When I go to "/stylesheets/site.css"
|
13
|
+
Then I should see "55" lines
|
14
|
+
|
15
|
+
# Scenario: Rendering inline css with the feature enabled
|
16
|
+
# Given "minify_css" feature is "enabled"
|
17
|
+
# When I go to "/inline-css.html"
|
18
|
+
# Then I should see "1" lines
|
19
|
+
|
20
|
+
Scenario: Rendering external css with the feature enabled
|
21
|
+
Given "minify_css" feature is "enabled"
|
22
|
+
And the Server is running at "test-app"
|
23
|
+
When I go to "/stylesheets/site.css"
|
24
|
+
Then I should see "1" lines
|
@@ -0,0 +1,23 @@
|
|
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 "test-app"
|
10
|
+
When I go to "/inline-js.html"
|
11
|
+
Then I should see "10" lines
|
12
|
+
|
13
|
+
Scenario: Rendering inline js with the feature enabled
|
14
|
+
Given "minify_javascript" feature is "enabled"
|
15
|
+
And the Server is running at "test-app"
|
16
|
+
When I go to "/inline-js.html"
|
17
|
+
Then I should see "5" lines
|
18
|
+
|
19
|
+
Scenario: Rendering inline js (coffeescript) with the feature enabled
|
20
|
+
Given "minify_javascript" feature is "enabled"
|
21
|
+
And the Server is running at "test-app"
|
22
|
+
When I go to "/inline-coffeescript.html"
|
23
|
+
Then I should see "5" lines
|
@@ -0,0 +1,10 @@
|
|
1
|
+
Feature: Built-in macro view helpers
|
2
|
+
In order to simplify generating HTML
|
3
|
+
|
4
|
+
Scenario: Using the link_to helper
|
5
|
+
Given the Server is running at "test-app"
|
6
|
+
When I go to "/padrino_test.html"
|
7
|
+
And I should see 'href="test2.com"'
|
8
|
+
And I should see 'src="/images/test2.png"'
|
9
|
+
Then I should see 'src="/javascripts/test1.js"'
|
10
|
+
Then I should see 'href="/stylesheets/test1.css"'
|
@@ -0,0 +1,44 @@
|
|
1
|
+
Feature: Custom layouts
|
2
|
+
In order easily switch between relative and absolute paths
|
3
|
+
|
4
|
+
Scenario: Using custom :layout attribute
|
5
|
+
Given page "/custom-layout.html" has layout "custom"
|
6
|
+
And the Server is running at "test-app"
|
7
|
+
When I go to "/custom-layout.html"
|
8
|
+
Then I should see "Custom Layout"
|
9
|
+
|
10
|
+
Scenario: Using with_layout block
|
11
|
+
Given "/custom-layout.html" with_layout block has layout "custom"
|
12
|
+
And the Server is running at "test-app"
|
13
|
+
When I go to "/custom-layout.html"
|
14
|
+
Then I should see "Custom Layout"
|
15
|
+
|
16
|
+
Scenario: Using custom :layout attribute with folders
|
17
|
+
Given page "/custom-layout-dir/" has layout "custom"
|
18
|
+
And the Server is running at "test-app"
|
19
|
+
When I go to "/custom-layout-dir"
|
20
|
+
Then I should see "Custom Layout"
|
21
|
+
When I go to "/custom-layout-dir/"
|
22
|
+
Then I should see "Custom Layout"
|
23
|
+
When I go to "/custom-layout-dir/index.html"
|
24
|
+
Then I should see "Custom Layout"
|
25
|
+
|
26
|
+
Scenario: Using custom :layout attribute with folders
|
27
|
+
Given page "/custom-layout-dir" has layout "custom"
|
28
|
+
And the Server is running at "test-app"
|
29
|
+
When I go to "/custom-layout-dir"
|
30
|
+
Then I should see "Custom Layout"
|
31
|
+
When I go to "/custom-layout-dir/"
|
32
|
+
Then I should see "Custom Layout"
|
33
|
+
When I go to "/custom-layout-dir/index.html"
|
34
|
+
Then I should see "Custom Layout"
|
35
|
+
|
36
|
+
Scenario: Using custom :layout attribute with folders
|
37
|
+
Given page "/custom-layout-dir/index.html" has layout "custom"
|
38
|
+
And the Server is running at "test-app"
|
39
|
+
When I go to "/custom-layout-dir"
|
40
|
+
Then I should see "Custom Layout"
|
41
|
+
When I go to "/custom-layout-dir/"
|
42
|
+
Then I should see "Custom Layout"
|
43
|
+
When I go to "/custom-layout-dir/index.html"
|
44
|
+
Then I should see "Custom Layout"
|
@@ -0,0 +1,44 @@
|
|
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 "test-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 "test-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 "test-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 disabled
|
24
|
+
Given "relative_assets" feature is "enabled"
|
25
|
+
And the Server is running at "test-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 "test-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 "test-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"
|
@@ -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 "test-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 "test-app"
|
11
|
+
When I go to "/stylesheets/layout.css"
|
12
|
+
Then I should see "html"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
Feature: Sprockets
|
2
|
+
|
3
|
+
Scenario: Sprockets require
|
4
|
+
Given the Server is running at "test-app"
|
5
|
+
When I go to "/javascripts/sprockets_base.js"
|
6
|
+
Then I should see "sprockets_sub_function"
|
7
|
+
|
8
|
+
Scenario: Sprockets require with custom :js_dir
|
9
|
+
Given the Server is running at "sprockets-app"
|
10
|
+
When I go to "/library/javascripts/sprockets_base.js"
|
11
|
+
Then I should see "sprockets_sub_function"
|
12
|
+
|
13
|
+
Scenario: Sprockets should have access to yaml data
|
14
|
+
Given the Server is running at "test-app"
|
15
|
+
When I go to "/javascripts/multiple_engines.js"
|
16
|
+
Then I should see "Hello One"
|
17
|
+
|
18
|
+
Scenario: Multiple engine files should build correctly
|
19
|
+
Given a built app at "test-app"
|
20
|
+
Then "javascripts/multiple_engines.js" should exist at "test-app" and include "Hello One"
|
21
|
+
And cleanup built app at "test-app"
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
Given /^a built app at "([^"]*)"$/ do |path|
|
4
|
+
root = File.dirname(File.dirname(File.dirname(__FILE__)))
|
5
|
+
target = File.join(root, "fixtures", path)
|
6
|
+
build_cmd = File.expand_path(File.join(root, "bin", "middleman build"))
|
7
|
+
`cd #{target} && #{build_cmd}`
|
8
|
+
end
|
9
|
+
|
10
|
+
Then /^cleanup built app at "([^"]*)"$/ do |path|
|
11
|
+
root = File.dirname(File.dirname(File.dirname(__FILE__)))
|
12
|
+
target = File.join(root, "fixtures", path, "build")
|
13
|
+
FileUtils.rm_rf(target)
|
14
|
+
end
|
15
|
+
|
16
|
+
Given /^a built app at "([^"]*)" with flags "([^"]*)"$/ do |path, flags|
|
17
|
+
root = File.dirname(File.dirname(File.dirname(__FILE__)))
|
18
|
+
target = File.join(root, "fixtures", path)
|
19
|
+
build_cmd = File.expand_path(File.join(root, "bin", "middleman build"))
|
20
|
+
`cd #{target} && #{build_cmd} #{flags}`
|
21
|
+
end
|
22
|
+
|
23
|
+
Then /^"([^"]*)" should exist at "([^"]*)"$/ do |target_file, path|
|
24
|
+
root = File.dirname(File.dirname(File.dirname(__FILE__)))
|
25
|
+
target = File.join(root, "fixtures", path, "build", target_file)
|
26
|
+
File.exists?(target).should be_true
|
27
|
+
end
|
28
|
+
|
29
|
+
Then /^"([^"]*)" should exist at "([^"]*)" and include "([^"]*)"$/ do |target_file, path, expected|
|
30
|
+
root = File.dirname(File.dirname(File.dirname(__FILE__)))
|
31
|
+
target = File.join(root, "fixtures", path, "build", target_file)
|
32
|
+
File.exists?(target).should be_true
|
33
|
+
File.read(target).should include(expected)
|
34
|
+
end
|
35
|
+
|
36
|
+
Then /^"([^"]*)" should not exist at "([^"]*)"$/ do |target_file, path|
|
37
|
+
root = File.dirname(File.dirname(File.dirname(__FILE__)))
|
38
|
+
target = File.join(root, "fixtures", path, "build", target_file)
|
39
|
+
File.exists?(target).should be_false
|
40
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
Given /^generated directory at "([^\"]*)"$/ do |dirname|
|
4
|
+
target = File.join(File.dirname(File.dirname(File.dirname(__FILE__))), "fixtures", dirname)
|
5
|
+
init_cmd = File.expand_path(File.join(File.dirname(File.dirname(File.dirname(__FILE__))), "bin", "middleman init"))
|
6
|
+
`cd #{File.dirname(target)} && #{init_cmd} #{File.basename(target)}`
|
7
|
+
end
|
8
|
+
|
9
|
+
Then /^template files should exist at "([^\"]*)"$/ do |dirname|
|
10
|
+
target = File.join(File.dirname(File.dirname(File.dirname(__FILE__))), "fixtures", dirname)
|
11
|
+
template_glob = File.join(File.dirname(File.dirname(File.dirname(__FILE__))), "lib", "middleman", "templates", "default", "*/**/*")
|
12
|
+
|
13
|
+
Dir[template_glob].each do |f|
|
14
|
+
next if File.directory?(f)
|
15
|
+
File.exists?("#{target}/#{f.split('template/')[1]}").should be_true
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
Then /^empty directories should exist at "([^\"]*)"$/ do |dirname|
|
20
|
+
target = File.join(File.dirname(File.dirname(File.dirname(__FILE__))), "fixtures", dirname)
|
21
|
+
|
22
|
+
%w(source/stylesheets source/javascripts source/images).each do |d|
|
23
|
+
File.exists?("#{target}/#{d}").should be_true
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
Then /^cleanup at "([^\"]*)"$/ do |dirname|
|
28
|
+
target = File.join(File.dirname(File.dirname(File.dirname(__FILE__))), "fixtures", dirname)
|
29
|
+
FileUtils.rm_rf(target)
|
30
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
Given /^"([^\"]*)" feature is "([^\"]*)"$/ do |feature, state|
|
2
|
+
@server ||= Middleman.server
|
3
|
+
@server.set :show_exceptions, false
|
4
|
+
if state == "enabled"
|
5
|
+
@server.activate(feature.to_sym)
|
6
|
+
end
|
7
|
+
@server.set :environment, @current_env || :development
|
8
|
+
end
|
9
|
+
|
10
|
+
Given /^"([^\"]*)" is set to "([^\"]*)"$/ do |variable, value|
|
11
|
+
@server ||= Middleman.server
|
12
|
+
@server.set :show_exceptions, false
|
13
|
+
@server.set variable.to_sym, value
|
14
|
+
end
|
15
|
+
|
16
|
+
Given /^current environment is "([^\"]*)"$/ do |env|
|
17
|
+
@current_env = env.to_sym
|
18
|
+
end
|
19
|
+
|
20
|
+
Given /^the Server is running at "([^\"]*)"$/ do |app_path|
|
21
|
+
@server ||= Middleman.server
|
22
|
+
@server.set :show_exceptions, false
|
23
|
+
root = File.dirname(File.dirname(File.dirname(__FILE__)))
|
24
|
+
@server.set :root, File.join(root, "fixtures", app_path)
|
25
|
+
@browser = Rack::Test::Session.new(Rack::MockSession.new(@server.new))
|
26
|
+
end
|
27
|
+
|
28
|
+
When /^I go to "([^\"]*)"$/ do |url|
|
29
|
+
@browser.get(url)
|
30
|
+
end
|
31
|
+
|
32
|
+
Then /^I should see "([^\"]*)"$/ do |expected|
|
33
|
+
@browser.last_response.body.should include(expected)
|
34
|
+
end
|
35
|
+
|
36
|
+
Then /^I should see '([^\']*)'$/ do |expected|
|
37
|
+
@browser.last_response.body.should include(expected)
|
38
|
+
end
|
39
|
+
|
40
|
+
Then /^I should not see "([^\"]*)"$/ do |expected|
|
41
|
+
@browser.last_response.body.should_not include(expected)
|
42
|
+
end
|
43
|
+
|
44
|
+
Then /^I should see "([^\"]*)" lines$/ do |lines|
|
45
|
+
@browser.last_response.body.chomp.split($/).length.should == lines.to_i
|
46
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
Given /^page "([^\"]*)" has layout "([^\"]*)"$/ do |url, layout|
|
2
|
+
@server ||= Middleman.server
|
3
|
+
@server.set :show_exceptions, false
|
4
|
+
@server.page(url, :layout => layout.to_sym)
|
5
|
+
end
|
6
|
+
|
7
|
+
Given /^"([^\"]*)" with_layout block has layout "([^\"]*)"$/ do |url, layout|
|
8
|
+
@server ||= Middleman.server
|
9
|
+
@server.set :show_exceptions, false
|
10
|
+
@server.with_layout(layout.to_sym) do
|
11
|
+
page(url)
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
@wip
|
2
|
+
Feature: Tiny Src
|
3
|
+
In order automatically scale images for mobile devices
|
4
|
+
|
5
|
+
Scenario: Rendering html with the feature disabled
|
6
|
+
Given "tiny_src" feature is "disabled"
|
7
|
+
And the Server is running at "test-app"
|
8
|
+
When I go to "/tiny_src.html"
|
9
|
+
Then I should see "http://test.com/image.jpg"
|
10
|
+
|
11
|
+
Scenario: Rendering html with the feature enabled
|
12
|
+
Given "tiny_src" feature is "enabled"
|
13
|
+
And the Server is running at "test-app"
|
14
|
+
When I go to "/tiny_src.html"
|
15
|
+
Then I should see "http://i.tinysrc.mobi/http://test.com/image.jpg"
|