mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-11 18:04:22 +01:00
Updated to svn tags/tracks-1.6
This commit is contained in:
parent
103fcb8049
commit
02496f2d44
2274 changed files with 0 additions and 0 deletions
23
vendor/plugins/unobtrusive_javascript/test/lib/ptk/suite/difference.rb
vendored
Normal file
23
vendor/plugins/unobtrusive_javascript/test/lib/ptk/suite/difference.rb
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
class Test::Unit::TestCase
|
||||
|
||||
# http://project.ioni.st/post/217#post-217
|
||||
#
|
||||
# def test_new_publication
|
||||
# assert_difference(Publication, :count) do
|
||||
# post :create, :publication => {...}
|
||||
# # ...
|
||||
# end
|
||||
# end
|
||||
#
|
||||
# modified by mabs29 to include arguments
|
||||
def assert_difference(object, method = nil, difference = 1, *args)
|
||||
initial_value = object.send(method, *args)
|
||||
yield
|
||||
assert_equal initial_value + difference, object.send(method, *args), "#{object}##{method}"
|
||||
end
|
||||
|
||||
def assert_no_difference(object, method, *args, &block)
|
||||
assert_difference object, method, 0, *args, &block
|
||||
end
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue