aboutsummaryrefslogtreecommitdiff
path: root/spec/support/augeas.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/augeas.rb')
-rw-r--r--spec/support/augeas.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/support/augeas.rb b/spec/support/augeas.rb
index 4912e1a..7548684 100644
--- a/spec/support/augeas.rb
+++ b/spec/support/augeas.rb
@@ -19,9 +19,10 @@ module Augeas
[target, name, Change].hash
end
- def eql?(other)
+ def ==(other)
other.is_a?(self.class) && [other.target, other.name] == [target, name]
end
+ alias_method :eql?, :==
private
@@ -37,11 +38,12 @@ module Augeas
class ChangeSet
def initialize
- @set = {}
+ @set = []
end
def <<(change)
- @set[change] = change
+ index = @set.index(change) || @set.length
+ @set[index] = change
end
def to_a
@@ -49,7 +51,7 @@ module Augeas
end
def changes
- @set.values.map(&:to_s)
+ @set.map(&:to_s)
end
end