From b7c284e3f5b4a597d4c57a3558e68baf686096fb Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 25 Sep 2024 18:58:26 +0200 Subject: [PATCH] Remove leaky dummy class in inside_route_spec.rb --- spec/grape/dsl/inside_route_spec.rb | 30 +++++++++++++---------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/spec/grape/dsl/inside_route_spec.rb b/spec/grape/dsl/inside_route_spec.rb index d684f2597..ea33468da 100644 --- a/spec/grape/dsl/inside_route_spec.rb +++ b/spec/grape/dsl/inside_route_spec.rb @@ -1,25 +1,21 @@ # frozen_string_literal: true -module Grape - module DSL - module InsideRouteSpec - class Dummy - include Grape::DSL::InsideRoute - - attr_reader :env, :request, :new_settings - - def initialize - @env = {} - @header = {} - @new_settings = { namespace_inheritable: {}, namespace_stackable: {} } - end +describe Grape::Endpoint do + subject { dummy_class.new } + + let(:dummy_class) do + Class.new do + include Grape::DSL::InsideRoute + + attr_reader :env, :request, :new_settings + + def initialize + @env = {} + @header = {} + @new_settings = { namespace_inheritable: {}, namespace_stackable: {} } end end end -end - -describe Grape::Endpoint do - subject { Grape::DSL::InsideRouteSpec::Dummy.new } describe '#version' do it 'defaults to nil' do