diff options
Diffstat (limited to 'spec/lib/gitlab/sentry_spec.rb')
-rw-r--r-- | spec/lib/gitlab/sentry_spec.rb | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/spec/lib/gitlab/sentry_spec.rb b/spec/lib/gitlab/sentry_spec.rb index 1128eaf8560..88edd0e9b9a 100644 --- a/spec/lib/gitlab/sentry_spec.rb +++ b/spec/lib/gitlab/sentry_spec.rb @@ -1,8 +1,8 @@ -require 'spec_helper' +require "spec_helper" describe Gitlab::Sentry do - describe '.context' do - it 'adds the locale to the tags' do + describe ".context" do + it "adds the locale to the tags" do expect(described_class).to receive(:enabled?).and_return(true) described_class.context(nil) @@ -11,48 +11,48 @@ describe Gitlab::Sentry do end end - describe '.track_exception' do - let(:exception) { RuntimeError.new('boom') } + describe ".track_exception" do + let(:exception) { RuntimeError.new("boom") } before do allow(described_class).to receive(:enabled?).and_return(true) end - it 'raises the exception if it should' do + it "raises the exception if it should" do expect(described_class).to receive(:should_raise_for_dev?).and_return(true) expect { described_class.track_exception(exception) } .to raise_error(RuntimeError) end - context 'when exceptions should not be raised' do + context "when exceptions should not be raised" do before do allow(described_class).to receive(:should_raise_for_dev?).and_return(false) - allow(Gitlab::CorrelationId).to receive(:current_id).and_return('cid') + allow(Gitlab::CorrelationId).to receive(:current_id).and_return("cid") end - it 'logs the exception with all attributes passed' do + it "logs the exception with all attributes passed" do expected_extras = { - some_other_info: 'info', - issue_url: 'http://gitlab.com/gitlab-org/gitlab-ce/issues/1' + some_other_info: "info", + issue_url: "http://gitlab.com/gitlab-org/gitlab-ce/issues/1", } expected_tags = { - correlation_id: 'cid' + correlation_id: "cid", } expect(Raven).to receive(:capture_exception) - .with(exception, - tags: a_hash_including(expected_tags), - extra: a_hash_including(expected_extras)) + .with(exception, + tags: a_hash_including(expected_tags), + extra: a_hash_including(expected_extras)) described_class.track_exception( exception, - issue_url: 'http://gitlab.com/gitlab-org/gitlab-ce/issues/1', - extra: { some_other_info: 'info' } + issue_url: "http://gitlab.com/gitlab-org/gitlab-ce/issues/1", + extra: {some_other_info: "info"} ) end - it 'sets the context' do + it "sets the context" do expect(described_class).to receive(:context) described_class.track_exception(exception) @@ -60,33 +60,33 @@ describe Gitlab::Sentry do end end - context '.track_acceptable_exception' do - let(:exception) { RuntimeError.new('boom') } + context ".track_acceptable_exception" do + let(:exception) { RuntimeError.new("boom") } before do allow(described_class).to receive(:enabled?).and_return(true) - allow(Gitlab::CorrelationId).to receive(:current_id).and_return('cid') + allow(Gitlab::CorrelationId).to receive(:current_id).and_return("cid") end - it 'calls Raven.capture_exception' do + it "calls Raven.capture_exception" do expected_extras = { - some_other_info: 'info', - issue_url: 'http://gitlab.com/gitlab-org/gitlab-ce/issues/1' + some_other_info: "info", + issue_url: "http://gitlab.com/gitlab-org/gitlab-ce/issues/1", } expected_tags = { - correlation_id: 'cid' + correlation_id: "cid", } expect(Raven).to receive(:capture_exception) - .with(exception, - tags: a_hash_including(expected_tags), - extra: a_hash_including(expected_extras)) + .with(exception, + tags: a_hash_including(expected_tags), + extra: a_hash_including(expected_extras)) described_class.track_acceptable_exception( exception, - issue_url: 'http://gitlab.com/gitlab-org/gitlab-ce/issues/1', - extra: { some_other_info: 'info' } + issue_url: "http://gitlab.com/gitlab-org/gitlab-ce/issues/1", + extra: {some_other_info: "info"} ) end end |