-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fix select #18
Fix select #18
Conversation
@@ -217,7 +217,7 @@ def []=(key, value) | |||
# @param matcher [Matcher] | |||
# @return [Array<AugeasElement>] matching elements | |||
def select(matcher) | |||
@data.select(&matcher) | |||
data.select(&matcher) |
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.
Before this fix, this line is one of the four lines in this file not covered by tests :-)
describe "#select" do | ||
it "selects entries according to passed block" do | ||
matcher = CFA::Matcher.new(collection: "spec") | ||
expect(tree.select(matcher).size).to eq 2 |
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 don't understand this test at all.
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.
well, we have matcher, that select all elements in collection and then it verify that it find all 2 elements in collection.
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.
and later we do same, but before we delete one of elements in collection
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.
Well, yes, this part I understand. I meant to say that it is very hard to verify that the test does the right thing, because you have to look up the fixture config file, and the lens file (which is located completely elsewhere), then understand the rather complex lens.
cfa.gemspec
Outdated
@@ -1,6 +1,6 @@ | |||
Gem::Specification.new do |s| | |||
s.name = "cfa" | |||
s.version = "0.5.1" | |||
s.version = "0.6.0" |
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.
FYI cfa_grub2 will cry.
lib/cfa/augeas_parser/writer.rb
Outdated
@@ -198,6 +198,23 @@ def run | |||
|
|||
attr_reader :aug | |||
|
|||
# Removes entry from tree. If path do not exist, then try if it don't |
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.
Grrrammar...
lib/cfa/augeas_parser/writer.rb
Outdated
# "test" => remove, "lest" => remove, "test" => add | ||
# in this case it change after first add | ||
# "test[1]" => remove, "lest" => remove, "test[2]" => already added | ||
# so in this case try to append [1] to path |
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 understand what this means. Also, the verb grammar is bad.
No description provided.