Skip to content

Commit

Permalink
add specs covering the Message.load method
Browse files Browse the repository at this point in the history
this was tested incidentally through spec-support methods before, and
not intentionally through behavioral tests
  • Loading branch information
nevinera committed Jun 10, 2023
1 parent 19929e8 commit dc3d8e0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spec/quiet_quality/message_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
RSpec.describe QuietQuality::Message do
describe ".load" do
let(:data) { {path: "foo.rb", body: "some text", tool_name: :rspec, start_line: 52, level: "high"} }
subject(:loaded) { described_class.load(data) }
it { is_expected.to be_a(described_class) }

it "has the supplied attributes" do
expect(loaded.path).to eq("foo.rb")
expect(loaded.body).to eq("some text")
expect(loaded.tool_name).to eq(:rspec)
expect(loaded.start_line).to eq(52)
expect(loaded.level).to eq("high")
expect(loaded.rule).to be_nil
end
end

subject(:message) { described_class.new(**attributes) }

let(:attributes) do
Expand Down

0 comments on commit dc3d8e0

Please sign in to comment.