diff --git a/middleman-core/features/custom_layouts.feature b/middleman-core/features/custom_layouts.feature index 09c7faa1..27f7df08 100644 --- a/middleman-core/features/custom_layouts.feature +++ b/middleman-core/features/custom_layouts.feature @@ -1,14 +1,22 @@ Feature: Custom layouts In order easily switch between relative and absolute paths - + Scenario: Using custom :layout attribute - Given page "/custom-layout.html" has layout "custom" + Given a fixture app "custom-layout-app2" + And a file named "config.rb" with: + """ + page '/custom-layout.html', layout: :custom + """ And the Server is running at "custom-layout-app2" When I go to "/custom-layout.html" Then I should see "Custom Layout" - + Scenario: Using custom :layout attribute with folders - Given page "/custom-layout-dir/" has layout "custom" + Given a fixture app "custom-layout-app2" + And a file named "config.rb" with: + """ + page '/custom-layout-dir/', layout: :custom + """ And the Server is running at "custom-layout-app2" When I go to "/custom-layout-dir" Then I should see "Custom Layout" @@ -16,9 +24,13 @@ Feature: Custom layouts Then I should see "Custom Layout" When I go to "/custom-layout-dir/index.html" Then I should see "Custom Layout" - + Scenario: Using custom :layout attribute with folders - Given page "/custom-layout-dir" has layout "custom" + Given a fixture app "custom-layout-app2" + And a file named "config.rb" with: + """ + page '/custom-layout-dir', layout: :custom + """ And the Server is running at "custom-layout-app2" When I go to "/custom-layout-dir" Then I should see "Custom Layout" @@ -26,9 +38,13 @@ Feature: Custom layouts Then I should see "Custom Layout" When I go to "/custom-layout-dir/index.html" Then I should see "Custom Layout" - + Scenario: Using custom :layout attribute with folders - Given page "/custom-layout-dir/index.html" has layout "custom" + Given a fixture app "custom-layout-app2" + And a file named "config.rb" with: + """ + page '/custom-layout-dir/index.html', layout: :custom + """ And the Server is running at "custom-layout-app2" When I go to "/custom-layout-dir" Then I should see "Custom Layout" @@ -36,7 +52,7 @@ Feature: Custom layouts Then I should see "Custom Layout" When I go to "/custom-layout-dir/index.html" Then I should see "Custom Layout" - + Scenario: Setting layout inside a matching page block Given the Server is running at "page-helper-layout-block-app" When I go to "/index.html" diff --git a/middleman-core/features/step_definitions/page_layout_steps.rb b/middleman-core/features/step_definitions/page_layout_steps.rb deleted file mode 100644 index 46a27026..00000000 --- a/middleman-core/features/step_definitions/page_layout_steps.rb +++ /dev/null @@ -1,6 +0,0 @@ -Given /^page "([^\"]*)" has layout "([^\"]*)"$/ do |url, layout| - @initialize_commands ||= [] - @initialize_commands << lambda { - page(url, layout: layout.to_sym) - } -end diff --git a/middleman-core/lib/middleman-core/core_extensions/extensions.rb b/middleman-core/lib/middleman-core/core_extensions/extensions.rb index 2cfb6c41..dbe8715b 100644 --- a/middleman-core/lib/middleman-core/core_extensions/extensions.rb +++ b/middleman-core/lib/middleman-core/core_extensions/extensions.rb @@ -83,9 +83,6 @@ module Middleman # Search the root of the project for required files $LOAD_PATH.unshift(root) unless $LOAD_PATH.include?(root) - # Evaluate a passed block if given - config_context.instance_exec(&block) if block_given? - super ::Middleman::Extension.clear_after_extension_callbacks