Skip to content
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

Merged
merged 1 commit into from
Aug 28, 2017

Conversation

bmjen
Copy link
Contributor

@bmjen bmjen commented Aug 24, 2017

Upon successful generation of a new module, inform the user:

  • that the module has been generated successfully
  • where it is located
  • what to do next

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 93.557% when pulling e62fcba on bmjen:pdk-365 into d02f959 on puppetlabs:master.

@bmjen
Copy link
Contributor Author

bmjen commented Aug 24, 2017

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))
Copy link
Contributor

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...?

Copy link
Contributor Author

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.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.008%) to 93.691% when pulling 4d9e546 on bmjen:pdk-365 into bafb86f on puppetlabs:master.

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
Copy link
Contributor

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?

Copy link
Contributor

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

Copy link
Contributor

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?

@bmjen bmjen merged commit 35914f5 into puppetlabs:master Aug 28, 2017
@bmjen bmjen deleted the pdk-365 branch August 28, 2017 15:10
@DavidS DavidS added the feature label Sep 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants