diff --git a/.github/workflows/liquid.yml b/.github/workflows/liquid.yml index de57dd68d..c018a4954 100644 --- a/.github/workflows/liquid.yml +++ b/.github/workflows/liquid.yml @@ -1,5 +1,5 @@ name: Liquid -on: [push, pull_request] +on: [push] env: BUNDLE_JOBS: 4 @@ -32,7 +32,7 @@ jobs: } - { ruby: head, allowed-failure: true, rubyopt: "--yjit" } - { ruby: head, allowed-failure: true, rubyopt: "--zjit" } - name: Test Ruby ${{ matrix.entry.ruby }} + name: Test Ruby ${{ matrix.entry.ruby }} ${{ matrix.entry.rubyopt }} --${{ matrix.entry.allowed-failure && 'allowed-failure' || 'strict' }} steps: - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - uses: ruby/setup-ruby@a25f1e45f0e65a92fcb1e95e8847f78fb0a7197a # v1.273.0 diff --git a/Gemfile b/Gemfile index 4b68a939a..a6c448617 100644 --- a/Gemfile +++ b/Gemfile @@ -32,7 +32,6 @@ group :test do end group :spec do - # Using feature branch until https://github.com/Shopify/liquid-spec/pull/97 is merged gem 'liquid-spec', github: 'Shopify/liquid-spec', branch: 'main' gem 'activesupport', require: false end diff --git a/spec/ruby_liquid.rb b/spec/ruby_liquid.rb index 062e635f9..628fbbfe3 100644 --- a/spec/ruby_liquid.rb +++ b/spec/ruby_liquid.rb @@ -14,15 +14,14 @@ # Compile a template string into a Liquid::Template LiquidSpec.compile do |ctx, source, options| - Liquid::Template.parse(source, **options) + ctx[:template] = Liquid::Template.parse(source, **options) end # Render a compiled template with the given context -# @param ctx [Hash] adapter context (unused) -# @param template [Liquid::Template] compiled template +# @param ctx [Hash] adapter context containing :template # @param assigns [Hash] environment variables # @param options [Hash] :registers, :strict_errors, :exception_renderer -LiquidSpec.render do |ctx, template, assigns, options| +LiquidSpec.render do |ctx, assigns, options| registers = Liquid::Registers.new(options[:registers] || {}) context = Liquid::Context.build( @@ -33,5 +32,5 @@ context.exception_renderer = options[:exception_renderer] if options[:exception_renderer] - template.render(context) + ctx[:template].render(context) end diff --git a/spec/ruby_liquid_lax.rb b/spec/ruby_liquid_lax.rb index b9fc497a8..4681ad415 100644 --- a/spec/ruby_liquid_lax.rb +++ b/spec/ruby_liquid_lax.rb @@ -15,11 +15,11 @@ LiquidSpec.compile do |ctx, source, options| # Force lax mode options = options.merge(error_mode: :lax) - Liquid::Template.parse(source, **options) + ctx[:template] = Liquid::Template.parse(source, **options) end # Render a compiled template with the given context -LiquidSpec.render do |ctx, template, assigns, options| +LiquidSpec.render do |ctx, assigns, options| registers = Liquid::Registers.new(options[:registers] || {}) context = Liquid::Context.build( @@ -30,5 +30,5 @@ context.exception_renderer = options[:exception_renderer] if options[:exception_renderer] - template.render(context) + ctx[:template].render(context) end diff --git a/spec/ruby_liquid_with_active_support.rb b/spec/ruby_liquid_with_active_support.rb index ab1ada372..d8b05f76c 100644 --- a/spec/ruby_liquid_with_active_support.rb +++ b/spec/ruby_liquid_with_active_support.rb @@ -15,15 +15,14 @@ # Compile a template string into a Liquid::Template LiquidSpec.compile do |ctx, source, options| - Liquid::Template.parse(source, **options) + ctx[:template] = Liquid::Template.parse(source, **options) end # Render a compiled template with the given context -# @param ctx [Hash] adapter context (unused) -# @param template [Liquid::Template] compiled template +# @param ctx [Hash] adapter context containing :template # @param assigns [Hash] environment variables # @param options [Hash] :registers, :strict_errors, :exception_renderer -LiquidSpec.render do |ctx, template, assigns, options| +LiquidSpec.render do |ctx, assigns, options| registers = Liquid::Registers.new(options[:registers] || {}) context = Liquid::Context.build( @@ -34,5 +33,5 @@ context.exception_renderer = options[:exception_renderer] if options[:exception_renderer] - template.render(context) + ctx[:template].render(context) end diff --git a/spec/ruby_liquid_yjit.rb b/spec/ruby_liquid_yjit.rb index e34e0abb6..3ff51d1fd 100644 --- a/spec/ruby_liquid_yjit.rb +++ b/spec/ruby_liquid_yjit.rb @@ -22,11 +22,11 @@ LiquidSpec.compile do |ctx, source, options| # Force strict mode options = { error_mode: :strict }.merge(options) - Liquid::Template.parse(source, **options) + ctx[:template] = Liquid::Template.parse(source, **options) end # Render a compiled template with the given context -LiquidSpec.render do |ctx, template, assigns, options| +LiquidSpec.render do |ctx, assigns, options| registers = Liquid::Registers.new(options[:registers] || {}) context = Liquid::Context.build( @@ -37,5 +37,5 @@ context.exception_renderer = options[:exception_renderer] if options[:exception_renderer] - template.render(context) + ctx[:template].render(context) end