Skip to content

Commit

Permalink
refactor(*): fix Lint/ConstantDefinitionInBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
iberianpig committed Sep 28, 2022
1 parent 1007615 commit 60a532e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
6 changes: 4 additions & 2 deletions spec/lib/plugin/events/event_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ module Events
let(:event) { Event.new(**args) }
let(:args) { {tag: "text", record: "dummy_text"} }

class DummyRecord < Records::Record
end
before {
allow(Records::Record).to receive(:inherited) # disable autoload
stub_const("DummyRecord", Class.new(Records::Record))
}

describe "#record" do
context "with text" do
Expand Down
13 changes: 8 additions & 5 deletions spec/lib/plugin/events/records/record_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ module Plugin
module Events
module Records
RSpec.describe Record do
class DummyRecord < Records::Record
def type
:dummy
end
end
before {
allow(Record).to receive(:inherited) # disable autoload
stub_const("DummyRecord", Class.new(Record) do
def type
:dummy
end
end)
}
let(:record) { described_class.new }

describe "#type" do
Expand Down

0 comments on commit 60a532e

Please sign in to comment.