diff --git a/middleman-core/features/data.feature b/middleman-core/features/data.feature index 0c444f3c..7f7e36f7 100644 --- a/middleman-core/features/data.feature +++ b/middleman-core/features/data.feature @@ -24,4 +24,6 @@ Feature: Local Data API Scenario: Using nested data Given the Server is running at "nested-data-app" When I go to "/test.html" - Then I should see "test:Hello" + Then I should see "title1:Hello" + Then I should see "title2:More" + Then I should see "title3:Stuff" \ No newline at end of file diff --git a/middleman-core/features/support/env.rb b/middleman-core/features/support/env.rb index de32f2c7..222176e6 100644 --- a/middleman-core/features/support/env.rb +++ b/middleman-core/features/support/env.rb @@ -1,8 +1,17 @@ -require 'simplecov' - ENV["TEST"] = "true" ENV["AUTOLOAD_SPROCKETS"] = "false" +if ENV["COVERAGE"] && (RUBY_VERSION =~ /1\.9/ || RUBY_VERSION =~ /2\.0/)) + require 'simplecov' + SimpleCov.root(File.expand_path(File.dirname(__FILE__) + '/../..')) + SimpleCov.start do + add_filter '/features/' + add_filter '/spec/' + add_filter '/vendor' + add_filter '/step_definitions/' + end +end + PROJECT_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__))) require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman-core') require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman-core', 'step_definitions') diff --git a/middleman-core/fixtures/nested-data-app/data/examples/deeper/stuff.yml b/middleman-core/fixtures/nested-data-app/data/examples/deeper/stuff.yml new file mode 100644 index 00000000..da8fc12e --- /dev/null +++ b/middleman-core/fixtures/nested-data-app/data/examples/deeper/stuff.yml @@ -0,0 +1 @@ +title: "Stuff" \ No newline at end of file diff --git a/middleman-core/fixtures/nested-data-app/data/examples/more.yml b/middleman-core/fixtures/nested-data-app/data/examples/more.yml new file mode 100644 index 00000000..d9db7ccd --- /dev/null +++ b/middleman-core/fixtures/nested-data-app/data/examples/more.yml @@ -0,0 +1 @@ +title: "More" \ No newline at end of file diff --git a/middleman-core/fixtures/nested-data-app/source/test.html.erb b/middleman-core/fixtures/nested-data-app/source/test.html.erb index acd20c82..21d49d74 100644 --- a/middleman-core/fixtures/nested-data-app/source/test.html.erb +++ b/middleman-core/fixtures/nested-data-app/source/test.html.erb @@ -1 +1,3 @@ -<%= data.examples.map { |k, r| [k, r.title].join(":") }.join %> +title1:<%= data.examples.test.title %> +title2:<%= data.examples.more.title %> +title3:<%= data.examples.deeper.stuff.title %>