Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ source "https://rubygems.org"
gemspec

group :development, :test do
gem 'liquid', git: "https://github.com/Shopify/liquid"
# DO NOT MERGE THIS
gem 'liquid', git: "https://github.com/Shopify/liquid", branch: "error-message-with-filepath"
gem 'rake'
end

Expand Down
5 changes: 5 additions & 0 deletions lib/liquid/spec/adapter/liquid_ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def render(spec)
static_environments: spec.environment,
registers: Liquid::Registers.new(static_registers)
)
context.template_name = "templates/index"
template = Liquid::Template.parse(spec.template, error_mode: spec.error_mode, line_numbers: true)
template.render(context)
end
Expand All @@ -25,6 +26,10 @@ def read_template_file(template_path)
raise Liquid::FileSystemError, "Could not find asset #{full_name}"
end
end

def actual_template_name(snippet_name)
"snippets/" + snippet_name
end
end
end
end
Expand Down
12 changes: 6 additions & 6 deletions specs/liquid_ruby/specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2288,17 +2288,17 @@
details: details
url: https://github.com/Shopify/liquid/blob/e804f36681015c2fc9605e1b3049a832310be62f/test/integration/tags/include_tag_test.rb#L140
- template: "{% include 123 %}"
expected: 'Liquid error (line 1): Argument error in tag ''include'' - Illegal template
expected: 'Liquid error (templates/index line 1): Argument error in tag ''include'' - Illegal template
name'
name: IncludeTagTest#test_render_raise_argument_error_when_template_is_not_a_string_403d47cecd937950631d8e1d59cc7382
url: https://github.com/Shopify/liquid/blob/e804f36681015c2fc9605e1b3049a832310be62f/test/integration/tags/include_tag_test.rb#L253
- template: "{% include undefined_variable %}"
expected: 'Liquid error (line 1): Argument error in tag ''include'' - Illegal template
expected: 'Liquid error (templates/index line 1): Argument error in tag ''include'' - Illegal template
name'
name: IncludeTagTest#test_render_raise_argument_error_when_template_is_undefined_4d409c2d09f126f67a94ab048a80ae31
url: https://github.com/Shopify/liquid/blob/e804f36681015c2fc9605e1b3049a832310be62f/test/integration/tags/include_tag_test.rb#L245
- template: "{% include nil %}"
expected: 'Liquid error (line 1): Argument error in tag ''include'' - Illegal template
expected: 'Liquid error (templates/index line 1): Argument error in tag ''include'' - Illegal template
name'
name: IncludeTagTest#test_render_raise_argument_error_when_template_is_undefined_fd16a0e80355cc8e550ad10d246f6339
url: https://github.com/Shopify/liquid/blob/e804f36681015c2fc9605e1b3049a832310be62f/test/integration/tags/include_tag_test.rb#L248
Expand Down Expand Up @@ -2618,8 +2618,8 @@
decr: "{% decrement %}"
url: https://github.com/Shopify/liquid/blob/e804f36681015c2fc9605e1b3049a832310be62f/test/integration/tags/render_tag_test.rb#L115
- template: '{% render "nested_render_with_sibling_include" %}'
expected: 'Liquid error (test_include line 1): include usage is not allowed in this
contextLiquid error (nested_render_with_sibling_include line 1): include usage
expected: 'Liquid error (snippets/test_include line 1): include usage is not allowed in this
contextLiquid error (snippets/nested_render_with_sibling_include line 1): include usage
is not allowed in this context'
name: RenderTagTest#test_includes_will_not_render_inside_nested_sibling_tags_7252ebefc8aeddf28f05d56a12bfbb15
filesystem:
Expand All @@ -2629,7 +2629,7 @@
test_include: '{% include "foo" %}'
url: https://github.com/Shopify/liquid/blob/e804f36681015c2fc9605e1b3049a832310be62f/test/integration/tags/render_tag_test.rb#L132
- template: '{% render "test_include" %}'
expected: 'Liquid error (test_include line 1): include usage is not allowed in this
expected: 'Liquid error (snippets/test_include line 1): include usage is not allowed in this
context'
name: RenderTagTest#test_includes_will_not_render_inside_render_tag_6adab3b1d0532bc84aa45d1fbeb048f4
filesystem:
Expand Down