Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed a for ubuntu

  • Loading branch information...
commit 37272908ee91213e102a8610ee65534a57d37395 1 parent 0c182a9
Nathan Stults authored
Showing with 27 additions and 3 deletions.
  1. +24 −0 Gemfile.lock
  2. +3 −3 test/test_hash_watcher.rb
24 Gemfile.lock
View
@@ -0,0 +1,24 @@
+PATH
+ remote: .
+ specs:
+ observables (0.1.1)
+ activesupport (~> 3.0.0)
+ i18n
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ activesupport (3.0.0)
+ i18n (0.4.1)
+ rake (0.8.7)
+ shoulda (2.11.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ activesupport (~> 3.0.0)
+ i18n
+ observables!
+ rake
+ shoulda (~> 2.11)
6 test/test_hash_watcher.rb
View
@@ -14,7 +14,7 @@ class << h
before_methods, after_methods = [],[]
method_list = Observables::HashWatcher::MODIFIER_METHODS
@hash.subscribe(/before_modified/){|_,args|before_methods<<args[:trigger]}
- @hash.subscribe(/after_modified/) {|_,args|after_methods<<args[:trigger]}
+ @hash.subscribe(/after_modified/){|_,args|after_methods<<args[:trigger]}
method_list.each do |method|
args = args_for(method)
args ? @hash.send(method,args) : @hash.send(method)
@@ -53,7 +53,7 @@ class << h
end
end
should "calculate changes for #clear" do
- assert_equal @hash.to_a, get_changes(@hash){@hash.clear}[:removed]
+ assert_equal [], @hash.to_a - get_changes(@hash){@hash.clear}[:removed]
end
should "calculate changes for #delete" do
assert_equal({:a=>1}.to_a, get_changes(@hash){@hash.delete(:a)}[:removed])
@@ -85,4 +85,4 @@ def get_changes(hash)
hash.unsubscribe(sub)
changes.pop
end
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.