forked from clio/ten_years_rails
-
Notifications
You must be signed in to change notification settings - Fork 40
Adds BundleReport CLI class to an entry point from executable file #154
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
Merged
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
9f87ff1
[wip] start moving executable code to CLI class
hmdros 5d49ec0
[wip] add require to optparse
hmdros 66bed8c
[wip] remove duplicated require to optparse
hmdros 49928b8
move require bundler/setup to executable file
hmdros 83cccf6
add todo to validate args
hmdros fb03dfa
remove .gem file from git
hmdros 3c203a7
refactor run method, add validation to arguments
hmdros 15e36e6
[wip] adding tests to new CLI class
hmdros b050e8d
[wip] adjusting specs
hmdros c8397dc
Specify which array option_parser.parse! should parse
ABizzinotto 0eef937
fix default behavior
hmdros f53028c
Move from single to double quotes
ABizzinotto a8431de
Add changelog entry
JuanVqz 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
require 'spec_helper' | ||
require 'byebug' | ||
|
||
RSpec.describe NextRails::BundleReport::CLI do | ||
describe '#initialize' do | ||
it 'raises if called with invalid arguments' do | ||
expect { described_class.new(['invalid_report_type']) } | ||
.to raise_error(ArgumentError, | ||
/Invalid report type 'invalid_report_type'. Valid types are: outdated, compatibility, ruby_check./) | ||
end | ||
|
||
it 'calls outdated if called with outdated' do | ||
expect(NextRails::BundleReport).to receive(:outdated) | ||
described_class.new(['outdated']).run | ||
end | ||
|
||
it 'calls compatible_ruby_version if called with ruby_check' do | ||
expect(NextRails::BundleReport).to receive(:compatible_ruby_version) | ||
described_class.new(['ruby_check', '--rails-version=7.0.0']).run | ||
end | ||
|
||
it 'calls rails_compatibility if called with compatibility with rails-version option' do | ||
expect(NextRails::BundleReport).to receive(:rails_compatibility) | ||
described_class.new(['compatibility', '--rails-version=7.0.0']).run | ||
end | ||
|
||
it 'calls ruby_compatibility if called with compatibility with ruby-version option' do | ||
expect(NextRails::BundleReport).to receive(:ruby_compatibility) | ||
described_class.new(['compatibility', '--ruby-version=3.2.0']).run | ||
end | ||
end | ||
end |
Oops, something went wrong.
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.
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.