middleman 2.0.9.pre.2-x86-mingw32

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.
Files changed (197) hide show
  1. data/.gemtest +0 -0
  2. data/.gitignore +13 -0
  3. data/.travis.yml +4 -0
  4. data/CHANGELOG +47 -0
  5. data/Gemfile +3 -0
  6. data/LICENSE +20 -0
  7. data/README.md +19 -0
  8. data/Rakefile +15 -0
  9. data/bin/middleman +73 -0
  10. data/bin/mm-build +9 -0
  11. data/bin/mm-init +9 -0
  12. data/bin/mm-server +9 -0
  13. data/features/asset_host.feature +14 -0
  14. data/features/automatic_image_sizes.feature +16 -0
  15. data/features/builder.feature +23 -0
  16. data/features/cache_buster.feature +26 -0
  17. data/features/coffee-script.feature +17 -0
  18. data/features/data.feature +12 -0
  19. data/features/directory_index.feature +29 -0
  20. data/features/dynamic_pages.feature +33 -0
  21. data/features/front-matter.feature +7 -0
  22. data/features/generator.feature +8 -0
  23. data/features/helpers_auto_javascript_include_tag.feature +27 -0
  24. data/features/helpers_auto_stylesheet_link_tag.feature +27 -0
  25. data/features/helpers_page_classes.feature +17 -0
  26. data/features/liquid.feature +6 -0
  27. data/features/markdown.feature +7 -0
  28. data/features/minify_css.feature +24 -0
  29. data/features/minify_javascript.feature +23 -0
  30. data/features/padrino_helpers.feature +10 -0
  31. data/features/page_alias_and_layouts.feature +44 -0
  32. data/features/relative_assets.feature +44 -0
  33. data/features/scss-support.feature +12 -0
  34. data/features/sinatra.feature +6 -0
  35. data/features/slim.feature +7 -0
  36. data/features/sprockets.feature +21 -0
  37. data/features/sprockets_gems.feature +7 -0
  38. data/features/step_definitions/asset_host_steps.rb +8 -0
  39. data/features/step_definitions/builder_steps.rb +40 -0
  40. data/features/step_definitions/generator_steps.rb +30 -0
  41. data/features/step_definitions/middleman_steps.rb +46 -0
  42. data/features/step_definitions/page_layout_steps.rb +13 -0
  43. data/features/support/env.rb +3 -0
  44. data/features/tiny_src.feature +15 -0
  45. data/fixtures/indexable-app/config.rb +2 -0
  46. data/fixtures/indexable-app/source/a_folder/needs_index.html +1 -0
  47. data/fixtures/indexable-app/source/leave_me_alone.html +1 -0
  48. data/fixtures/indexable-app/source/needs_index.html +1 -0
  49. data/fixtures/indexable-app/source/regular/index.html +1 -0
  50. data/fixtures/relative-app/config.rb +0 -0
  51. data/fixtures/relative-app/source/images/blank.gif +0 -0
  52. data/fixtures/relative-app/source/stylesheets/relative_assets.css.sass +3 -0
  53. data/fixtures/sprockets-app/config.rb +1 -0
  54. data/fixtures/sprockets-app/source/jquery_include.js +1 -0
  55. data/fixtures/sprockets-app/source/library/javascripts/sprockets_base.js +5 -0
  56. data/fixtures/sprockets-app/source/library/javascripts/sprockets_sub.js +3 -0
  57. data/fixtures/test-app/config.rb +51 -0
  58. data/fixtures/test-app/data/test.yml +4 -0
  59. data/fixtures/test-app/source/_liquid_partial.liquid +1 -0
  60. data/fixtures/test-app/source/_partial.haml +1 -0
  61. data/fixtures/test-app/source/a_folder/needs_index.html +1 -0
  62. data/fixtures/test-app/source/asset_host.html.haml +1 -0
  63. data/fixtures/test-app/source/auto-css.html.haml +1 -0
  64. data/fixtures/test-app/source/auto-css/auto-css.html.haml +1 -0
  65. data/fixtures/test-app/source/auto-css/index.html.haml +1 -0
  66. data/fixtures/test-app/source/auto-css/sub/auto-css.html.haml +1 -0
  67. data/fixtures/test-app/source/auto-image-sizes.html.haml +1 -0
  68. data/fixtures/test-app/source/auto-js.html.haml +1 -0
  69. data/fixtures/test-app/source/auto-js/auto-js.html.haml +1 -0
  70. data/fixtures/test-app/source/auto-js/index.html.haml +1 -0
  71. data/fixtures/test-app/source/auto-js/sub/auto-js.html.haml +1 -0
  72. data/fixtures/test-app/source/cache-buster.html.haml +2 -0
  73. data/fixtures/test-app/source/custom-layout-dir/index.html.haml +1 -0
  74. data/fixtures/test-app/source/custom-layout.html.haml +1 -0
  75. data/fixtures/test-app/source/data.html.erb +1 -0
  76. data/fixtures/test-app/source/data2.html.liquid +2 -0
  77. data/fixtures/test-app/source/front-matter.html.erb +6 -0
  78. data/fixtures/test-app/source/images/Child folder/regular_file(example).txt +1 -0
  79. data/fixtures/test-app/source/images/Read me (example).txt +1 -0
  80. data/fixtures/test-app/source/images/blank.gif +0 -0
  81. data/fixtures/test-app/source/img/blank.gif +0 -0
  82. data/fixtures/test-app/source/index.html.haml +6 -0
  83. data/fixtures/test-app/source/inline-coffeescript.html.haml +3 -0
  84. data/fixtures/test-app/source/inline-css.html.haml +4 -0
  85. data/fixtures/test-app/source/inline-js.html.haml +7 -0
  86. data/fixtures/test-app/source/javascripts/auto-js.js +1 -0
  87. data/fixtures/test-app/source/javascripts/auto-js/auto-js.js +1 -0
  88. data/fixtures/test-app/source/javascripts/auto-js/index.js +1 -0
  89. data/fixtures/test-app/source/javascripts/auto-js/sub/auto-js.js +1 -0
  90. data/fixtures/test-app/source/javascripts/broken-coffee.js.coffee +3 -0
  91. data/fixtures/test-app/source/javascripts/coffee_test.js.coffee +3 -0
  92. data/fixtures/test-app/source/javascripts/jquery.plugin.with.dots.js +1 -0
  93. data/fixtures/test-app/source/javascripts/jquery_base.js +5 -0
  94. data/fixtures/test-app/source/javascripts/multiple_engines.js.coffee.erb +1 -0
  95. data/fixtures/test-app/source/javascripts/sprockets_base.js +5 -0
  96. data/fixtures/test-app/source/javascripts/sprockets_sub.js +3 -0
  97. data/fixtures/test-app/source/layout.haml +6 -0
  98. data/fixtures/test-app/source/layouts/custom.haml +5 -0
  99. data/fixtures/test-app/source/liquid_master.html.liquid +1 -0
  100. data/fixtures/test-app/source/markdown.html.markdown +1 -0
  101. data/fixtures/test-app/source/needs_index.html +1 -0
  102. data/fixtures/test-app/source/padrino_test.html.haml +5 -0
  103. data/fixtures/test-app/source/page-classes.html.haml +1 -0
  104. data/fixtures/test-app/source/real.html +1 -0
  105. data/fixtures/test-app/source/real/index.html.erb +5 -0
  106. data/fixtures/test-app/source/relative_image.html.erb +1 -0
  107. data/fixtures/test-app/source/services/index.html.haml +1 -0
  108. data/fixtures/test-app/source/should_be_ignored.html +1 -0
  109. data/fixtures/test-app/source/should_be_ignored2.html +1 -0
  110. data/fixtures/test-app/source/should_be_ignored3.html +1 -0
  111. data/fixtures/test-app/source/slim.html.slim +7 -0
  112. data/fixtures/test-app/source/spaces in file.html.erb +1 -0
  113. data/fixtures/test-app/source/static.html +1 -0
  114. data/fixtures/test-app/source/stylesheets/asset_host.css.sass +3 -0
  115. data/fixtures/test-app/source/stylesheets/auto-css.css +3 -0
  116. data/fixtures/test-app/source/stylesheets/auto-css/auto-css.css +3 -0
  117. data/fixtures/test-app/source/stylesheets/auto-css/index.css +0 -0
  118. data/fixtures/test-app/source/stylesheets/auto-css/sub/auto-css.css +3 -0
  119. data/fixtures/test-app/source/stylesheets/layout.css.sass +2 -0
  120. data/fixtures/test-app/source/stylesheets/relative_assets.css.sass +3 -0
  121. data/fixtures/test-app/source/stylesheets/site.css.sass +1 -0
  122. data/fixtures/test-app/source/stylesheets/site_scss.css.scss +1 -0
  123. data/fixtures/test-app/source/stylesheets/static.css +2 -0
  124. data/fixtures/test-app/source/sub1/page-classes.html.haml +1 -0
  125. data/fixtures/test-app/source/sub1/sub2/page-classes.html.haml +1 -0
  126. data/fixtures/test-app/source/tiny_src.html.haml +1 -0
  127. data/lib/middleman.rb +202 -0
  128. data/lib/middleman/base.rb +198 -0
  129. data/lib/middleman/builder.rb +163 -0
  130. data/lib/middleman/cli.rb +87 -0
  131. data/lib/middleman/config.ru +2 -0
  132. data/lib/middleman/core_extensions/assets.rb +57 -0
  133. data/lib/middleman/core_extensions/builder.rb +41 -0
  134. data/lib/middleman/core_extensions/compass.rb +102 -0
  135. data/lib/middleman/core_extensions/data.rb +120 -0
  136. data/lib/middleman/core_extensions/default_helpers.rb +77 -0
  137. data/lib/middleman/core_extensions/features.rb +102 -0
  138. data/lib/middleman/core_extensions/front_matter.rb +116 -0
  139. data/lib/middleman/core_extensions/rack_map.rb +35 -0
  140. data/lib/middleman/core_extensions/rendering.rb +19 -0
  141. data/lib/middleman/core_extensions/routing.rb +87 -0
  142. data/lib/middleman/core_extensions/sprockets.rb +102 -0
  143. data/lib/middleman/features/asset_host.rb +22 -0
  144. data/lib/middleman/features/automatic_image_sizes.rb +31 -0
  145. data/lib/middleman/features/automatic_image_sizes/fastimage.rb +287 -0
  146. data/lib/middleman/features/cache_buster.rb +42 -0
  147. data/lib/middleman/features/directory_indexes.rb +56 -0
  148. data/lib/middleman/features/lorem.rb +126 -0
  149. data/lib/middleman/features/minify_css.rb +10 -0
  150. data/lib/middleman/features/minify_javascript.rb +43 -0
  151. data/lib/middleman/features/relative_assets.rb +38 -0
  152. data/lib/middleman/features/tiny_src.rb +11 -0
  153. data/lib/middleman/guard.rb +70 -0
  154. data/lib/middleman/renderers/coffee_script.rb +8 -0
  155. data/lib/middleman/renderers/haml.rb +31 -0
  156. data/lib/middleman/renderers/liquid.rb +29 -0
  157. data/lib/middleman/renderers/markdown.rb +34 -0
  158. data/lib/middleman/renderers/sass.rb +63 -0
  159. data/lib/middleman/renderers/slim.rb +8 -0
  160. data/lib/middleman/templates.rb +53 -0
  161. data/lib/middleman/templates/default.rb +17 -0
  162. data/lib/middleman/templates/default/source/index.html.erb +5 -0
  163. data/lib/middleman/templates/default/source/layout.erb +19 -0
  164. data/lib/middleman/templates/default/source/stylesheets/site.css.scss +32 -0
  165. data/lib/middleman/templates/html5.rb +16 -0
  166. data/lib/middleman/templates/html5/source/404.html +38 -0
  167. data/lib/middleman/templates/html5/source/README.md +388 -0
  168. data/lib/middleman/templates/html5/source/apple-touch-icon-114x114-precomposed.png +0 -0
  169. data/lib/middleman/templates/html5/source/apple-touch-icon-57x57-precomposed.png +0 -0
  170. data/lib/middleman/templates/html5/source/apple-touch-icon-72x72-precomposed.png +0 -0
  171. data/lib/middleman/templates/html5/source/apple-touch-icon-precomposed.png +0 -0
  172. data/lib/middleman/templates/html5/source/apple-touch-icon.png +0 -0
  173. data/lib/middleman/templates/html5/source/crossdomain.xml +25 -0
  174. data/lib/middleman/templates/html5/source/css/style.css +293 -0
  175. data/lib/middleman/templates/html5/source/favicon.ico +0 -0
  176. data/lib/middleman/templates/html5/source/humans.txt +43 -0
  177. data/lib/middleman/templates/html5/source/img/.gitignore +2 -0
  178. data/lib/middleman/templates/html5/source/index.html +79 -0
  179. data/lib/middleman/templates/html5/source/js/libs/jquery-1.6.2.js +8981 -0
  180. data/lib/middleman/templates/html5/source/js/libs/jquery-1.6.2.min.js +18 -0
  181. data/lib/middleman/templates/html5/source/js/libs/modernizr-2.0.6.min.js +4 -0
  182. data/lib/middleman/templates/html5/source/js/mylibs/.gitignore +2 -0
  183. data/lib/middleman/templates/html5/source/js/plugins.js +20 -0
  184. data/lib/middleman/templates/html5/source/js/script.js +8 -0
  185. data/lib/middleman/templates/html5/source/robots.txt +5 -0
  186. data/lib/middleman/templates/html5/source/test/index.html +31 -0
  187. data/lib/middleman/templates/html5/source/test/qunit/qunit.css +148 -0
  188. data/lib/middleman/templates/html5/source/test/qunit/qunit.js +1265 -0
  189. data/lib/middleman/templates/html5/source/test/tests.js +24 -0
  190. data/lib/middleman/templates/local.rb +20 -0
  191. data/lib/middleman/templates/shared/Gemfile.tt +3 -0
  192. data/lib/middleman/templates/shared/config.ru +4 -0
  193. data/lib/middleman/templates/shared/config.tt +104 -0
  194. data/lib/middleman/version.rb +3 -0
  195. data/middleman-x86-mingw32.gemspec +78 -0
  196. data/middleman.gemspec +78 -0
  197. metadata +812 -0
@@ -0,0 +1,27 @@
1
+ Feature: Built-in auto_javascript_include_tag view helper
2
+ In order to simplify including javascript files
3
+
4
+ Scenario: Viewing the root path
5
+ Given the Server is running at "test-app"
6
+ When I go to "/auto-js.html"
7
+ Then I should see "javascripts/auto-js.js"
8
+
9
+ Scenario: Viewing a tier-1 path
10
+ Given the Server is running at "test-app"
11
+ When I go to "/auto-js/auto-js.html"
12
+ Then I should see "javascripts/auto-js/auto-js.js"
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-js"
17
+ Then I should see "javascripts/auto-js/index.js"
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-js/"
22
+ Then I should see "javascripts/auto-js/index.js"
23
+
24
+ Scenario: Viewing a tier-2 path
25
+ Given the Server is running at "test-app"
26
+ When I go to "/auto-js/sub/auto-js.html"
27
+ Then I should see "javascripts/auto-js/sub/auto-js.js"
@@ -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,6 @@
1
+ Feature: Support liquid partials
2
+
3
+ Scenario: Rendering liquid
4
+ Given the Server is running at "test-app"
5
+ When I go to "/liquid_master.html"
6
+ Then I should see "Greetings"
@@ -0,0 +1,7 @@
1
+ Feature: Markdown support
2
+ In order to test included Maruku support
3
+
4
+ Scenario: Rendering html
5
+ Given the Server is running at "test-app"
6
+ When I go to "/markdown.html"
7
+ Then I should see "<p>Hello World</p>"
@@ -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,6 @@
1
+ Feature: Sinatra Routes
2
+
3
+ Scenario: Rendering html
4
+ Given the Server is running at "test-app"
5
+ When I go to "/sinatra_test"
6
+ Then I should see "Ratpack"
@@ -0,0 +1,7 @@
1
+ Feature: Support slim templating language
2
+ In order to offer an alternative to Haml
3
+
4
+ Scenario: Rendering Slim
5
+ Given the Server is running at "test-app"
6
+ When I go to "/slim.html"
7
+ Then I should see "<h1>Welcome to Slim</h1>"
@@ -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,7 @@
1
+ @wip
2
+ Feature: Sprockets Gems
3
+
4
+ Scenario: Sprockets can pull jQuery from gem
5
+ Given the Server is running at "sprockets-app"
6
+ When I go to "/javascripts/jquery_include.js"
7
+ Then I should see "var jQuery ="
@@ -0,0 +1,8 @@
1
+ Given /^I am using an asset host$/ do
2
+ @server ||= Middleman.server
3
+ @server.set :show_exceptions, false
4
+ @server.activate :asset_host
5
+ @server.set :asset_host do |asset|
6
+ "http://assets%d.example.com" % (asset.hash % 4)
7
+ end
8
+ end
@@ -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