-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix config.log_silently? #324
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,17 @@ | |
it "should default log_silently to true" do | ||
expect(AssetSync.config.log_silently).to be_truthy | ||
end | ||
|
||
it "log_silently? should reflect the configuration" do | ||
AssetSync.config.log_silently = false | ||
expect(AssetSync.config.log_silently?).to eq(false) | ||
end | ||
|
||
it "log_silently? should always be true if ENV['RAILS_GROUPS'] == 'assets'" do | ||
AssetSync.config.log_silently = false | ||
expect(ENV).to receive(:[]).with('RAILS_GROUPS').and_return('assets') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it should be If I guess it wrong please tell me what it is. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK I think it's fine to have Edit: Changed some wording There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is self-explanatory, but I have added a comment to be sure :) |
||
expect(AssetSync.config.log_silently?).to eq(true) | ||
end | ||
|
||
it "should default cdn_distribution_id to nil" do | ||
expect(AssetSync.config.cdn_distribution_id).to be_nil | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we consider
nil
asfalse
?I know the default value is
true
, but if someone accidentally assignednil
to that attributeShould we throw warning or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe if we warned on nil elsewhere in handling the config options? For something as benign as logging, casting
nil
tofalse
is probably OK :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK let's do it later (maybe until someone complains)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍