Skip to content

Conversation

@wolfgang42
Copy link
Collaborator

For development, I have a script that wraps my command and runs bashly generate before each invocation to pick up any changes I've made. In this situation, the output of the generation is extraneous and distracting, so I've added a --quiet switch which hides all the boring changes (though it does still print created #{file} after generating any new files).


context "when source files already exist" do
before do
expect { subject.run %w[generate --quiet] } #.to output_nothing
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rspec_approvals gem doesn't seem to like empty output, which is awkward in this situation. Since you're the creator of both gems I figured you'd have an idea about what to do here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it is by design. An empty output can be tested with .to be_empty and there is no need for an approval matcher. So, it is usually a mistake when you use any of the approval matches, with an empty output. But don't worry about it, I will take a deeper look in the spec and fix accordingly.

@DannyBen
Copy link
Member

Excellent idea, and a great implementation - thanks for both.

I will review the PR locally, and probably make a few adjustments, and fix whatever problem there is with rspec_approval.

it does still print created #{file} after generating any new files).

Why is that? Shouldn't --quiet be completely quiet? Then it might bother someone else, who might want a --completely-quiet flag, no?

@DannyBen DannyBen changed the title bashly generate --quiet Add bashly generate --quiet Sep 30, 2021
@DannyBen
Copy link
Member

I have made my updated in #112, let us continue discussion there.

I will also probably merge #110 into it.

@DannyBen DannyBen closed this in #112 Oct 1, 2021
DannyBen added a commit that referenced this pull request Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants