-
Notifications
You must be signed in to change notification settings - Fork 656
Make with_comment_column
work with Annotate.set_defaults
#999
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
Merged
ctran
merged 10 commits into
ctran:develop
from
Adeynack:feature/make_with_comment_column_work_with_annotate_set_defaults
Nov 30, 2023
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ab2e641
kick in CI
Adeynack de3957d
Merge branch 'develop' of github.com:ctran/annotate_models into develop
Adeynack 913044d
Merge branch 'develop' of github.com:ctran/annotate_models into develop
Adeynack 2ff2fe7
read with_comment_column in rake task
Adeynack 756f71c
less diff
Adeynack df61c0c
add annotate_models config test
Adeynack d9cb25c
lint
Adeynack 5b35865
fix stub
Adeynack 6310406
reset `has_set_defaults` after test
Adeynack ae62b78
lint
Adeynack File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,36 @@ | ||
require_relative '../../spec_helper' | ||
|
||
describe 'Annotate annotate_models rake task and Annotate.set_defaults' do # rubocop:disable RSpec/DescribeClass | ||
before do | ||
Rake.application = Rake::Application.new | ||
Rake::Task.define_task('environment') | ||
Rake.load_rakefile('tasks/annotate_models.rake') | ||
end | ||
|
||
after do | ||
Annotate.instance_variable_set('@has_set_defaults', false) | ||
end | ||
|
||
let(:annotate_models_argument) do | ||
argument = nil | ||
allow(AnnotateModels).to receive(:do_annotations) { |arg| argument = arg } | ||
Rake::Task['annotate_models'].invoke | ||
argument | ||
end | ||
|
||
describe 'with_comment_column' do | ||
subject { annotate_models_argument[:with_comment_column] } | ||
|
||
after { ENV.delete('with_comment_column') } | ||
|
||
context 'when Annotate.set_defaults is not called (defaults)' do | ||
it { is_expected.to be_falsey } | ||
end | ||
|
||
context 'when Annotate.set_defaults sets it to "true"' do | ||
before { Annotate.set_defaults('with_comment_column' => 'true') } | ||
|
||
it { is_expected.to be_truthy } | ||
end | ||
end | ||
end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.