Skip to content

Commit

Permalink
Fix rspec expectation error
Browse files Browse the repository at this point in the history
  • Loading branch information
feelepxyz committed Oct 3, 2019
1 parent 079b7a0 commit 790a7c2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
12 changes: 8 additions & 4 deletions common/spec/dependabot/file_parsers/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,20 @@ def check_required_files
let(:files) { [gemfile] }

describe ".new" do
subject { -> { parser_instance } }

context "when the required file is present" do
let(:files) { [gemfile] }
it { is_expected.to_not raise_error }

it "doesn't raise" do
expect { parser_instance }.to_not raise_error
end
end

context "when the required file is missing" do
let(:files) { [] }
it { is_expected.to raise_error(/No Gemfile/) }

it "doesn't raise" do
expect { parser_instance }.to raise_error(/No Gemfile/)
end
end
end

Expand Down
10 changes: 8 additions & 2 deletions common/spec/dependabot/file_updaters/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,18 @@ def check_required_files

context "when the required file is present" do
let(:files) { [gemfile] }
it { is_expected.to_not raise_error }

it "doesn't raise" do
expect { updater_instance }.to_not raise_error
end
end

context "when the required file is missing" do
let(:files) { [] }
it { is_expected.to raise_error(/No Gemfile/) }

it "raises" do
expect { updater_instance }.to raise_error(/No Gemfile/)
end
end
end

Expand Down

0 comments on commit 790a7c2

Please sign in to comment.