-
-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1305 from tvdeyen/handle-picture-errors
Handle custom errors in Alchemy::Picture#url
- Loading branch information
Showing
6 changed files
with
69 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
require 'spec_helper' | ||
|
||
RSpec.describe Alchemy::Logger do | ||
let(:message) { "Something bad happened" } | ||
|
||
describe '.warn' do | ||
let(:caller_string) { "file.rb:14" } | ||
|
||
subject { Alchemy::Logger.warn(message, caller_string) } | ||
|
||
it { is_expected.to be_nil } | ||
|
||
it 'uses Rails debug logger' do | ||
expect(Rails.logger).to receive(:debug) { message } | ||
subject | ||
end | ||
end | ||
|
||
describe '#log_warning' do | ||
class Something | ||
include Alchemy::Logger | ||
end | ||
|
||
subject { Something.new.log_warning(message) } | ||
|
||
before do | ||
expect_any_instance_of(Something).to receive(:caller).with(1..1) { ["second"] } | ||
end | ||
|
||
it 'delegates to Alchemy::Logger.warn class method with second line of callstack' do | ||
expect(Alchemy::Logger).to receive(:warn).with(message, ["second"]) | ||
subject | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters