-
Notifications
You must be signed in to change notification settings - Fork 2
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
bundle_context: project_name alphanum-ish only; output_dir uses project_name instead of bundle_dir #320
Conversation
…ct_name instead of bundle_dir
Pull Request Test Coverage Report for Build 988
💛 - Coveralls |
5de46bb
to
ed06040
Compare
spec/models/bundle_context_spec.rb
Outdated
it { is_expected.to validate_presence_of(:project_name) } | ||
it 'is not valid with chars other than alphanum, hyphen and underscore' do | ||
attr_hash[:project_name] = 's p a c e s' | ||
expect(bc).not_to be_valid |
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.
I don't think this interaction is doing what you expect. attr_hash
and bc
are decoupled after the subject
is established. It would read more cleanly (and work) if you just do assignment on the object like:
bc.project_name = 'foo'
Ideally, start from a valid object and
expect { bc.project_name = 'bad value' }.to change(bc, :valid?).to(false)
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.
makes sense, i think...
for my own clarification, does that mean that the first time attr_hash
is edited, it does affect bc
(i.e. for the expectation this comment is on), and that for subsequent expectations, the changes to attr_hash
don't affect bc
, because bc
got lazily loaded upon the first reference to it? or is bc
already set up before this entire test is even entered, because it's declared using subject
? or something else?
anyway, i'd agree the suggested usage is more readable.
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.
thanks, @atz. I have added a commit to address my test giving a false positive.
dae8593
to
de0b39f
Compare
de0b39f
to
d401118
Compare
Also use `File.join` to build it. Update test to match, same as #320 (minor conflict).
Also use `File.join` to build it. Update test to match, same as #320 (minor conflict).
Per instructions from Ben on Slack, captured in #78 comments, use the project name rather than the bundle dir in the output directory for a bundle context.
Also, per separate slack conversation, also captured in #78 comments, restrict the characters allowed for the project name.
Lastly, fixes broken travis build.
Connects to #78