-
Notifications
You must be signed in to change notification settings - Fork 105
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
(PDK-365) Inform and prompt user following new module generate #270
Conversation
Going to add unit tests. |
shared_context 'allow post generate info to be printed to stdout' do | ||
before(:each) do | ||
allow($stdout).to receive(:puts).with(a_string_matching(%r{module.*generated at path.*}i)) | ||
allow($stdout).to receive(:puts).with(a_string_matching(%r{In your new module directory, add classes with the 'pdk new class' command}i)) |
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.
shouldn't that be expect post generate info...
?
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.
Yep. New updates should reflect actual testing. lol.
if FileUtils.mv(temp_target_dir, target_dir) | ||
PDK.logger.info(_('Module \'%{name}\' generated at path \'%{path}\'.') % { name: opts[:name], path: target_dir }) | ||
PDK.logger.info(_('In your new module directory, add classes with the \'pdk new class\' command.')) | ||
end |
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.
Is it possible for FileUtils.mv
to fail without raising an exception?
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.
Not that I've seen
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.
Sorry, I should have clarified the point of my question which was, why do we need that conditional around the log lines?
Upon successful generation of a new module, inform the user: