-
-
Notifications
You must be signed in to change notification settings - Fork 161
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
Add copy method to aruba #219
Conversation
This one needs to be discussed first... It might be helpfull to copy files from outside to |
I am open for adding a copy method to the API, but I think we should stick to a similar interface as Maybe the method name shold be Please also see #218 (comment) |
Ok. I see. I tried to mimic the original programs.
|
One question... What do you think... a) Source files should be expanded to current_dir? Based on experience I have made after I created the PR I would prefer b), but maybe c) also makes sense. |
Good idea. I consider it also good to mimic the interface of the methods in I think (c) due to API consistency. |
I think this is probably because you have your source files in a fixture directory which is up higher than current_dir. I think aruba could benefit to have a fixture directory configured and then maybe add support for fixture directory expansion like |
Correct. :-)
Ok. I would vote for
Should this be just an overwritable method? |
TODO:
|
Yeah, that would be great. Only one things to decide:
If you create another PR for this, we can have a vote for the choice of the prefix? I can also imagine Maybe the whole concept of a fixture directory should be in cucumber project? Well, then again, not... |
Taking the fixture expansion feature out of this PR discussion. I think this feature (copy) should work just like the other file operation features, that is paths are relative to current directory with home directory expansion using |
I will rework this when the other PRs are merged/declined. Does this make sense? |
I refactored the PR and would like to ask you for feedback. Each commit changes separate bits of aruba. |
@mattwynne |
source = source.flatten | ||
|
||
source.each do |s| | ||
raise ArgumentError, %(The following source "#{s}" does not exist.) unless exist? s |
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.
How about we extract this into #assert_exists
?
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.
Mmmh... assert_*
reads more like Test::Unit
I prefer to leave it like it is. BTW: I'm trying to remove as much assert_
-methods as possible (while keeping the api backwards-compatible for now). We may add a minitest
-integration which brings them back. WDYT?
I rebased this PR. |
Can we go on with that? 😄 |
Go for it! |
In one of my projects I need to copy files around during testing. I added a method to do this.
@jarl-dk Would you mind to review this?