diff options
author | jessib <jessib@riseup.net> | 2014-02-04 10:33:27 -0800 |
---|---|---|
committer | jessib <jessib@riseup.net> | 2014-02-04 10:33:27 -0800 |
commit | c7f376cdc02fe10c7e2a51c7d52475ab34451577 (patch) | |
tree | 75c52cbbd43bb55d155c301855677fcba123a2c7 /test/unit | |
parent | cda7ebacf35bcc0fcf233e5a23b958ed751fb108 (diff) | |
parent | c3cb71ca5e6d32960e4493d85799f3706ea91fe8 (diff) |
Merge pull request #9 from azul/test/integration-with-travis
Test/integration with travis
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/couch_changes_test.rb | 32 | ||||
-rw-r--r-- | test/unit/couch_stream_test.rb | 29 |
2 files changed, 0 insertions, 61 deletions
diff --git a/test/unit/couch_changes_test.rb b/test/unit/couch_changes_test.rb deleted file mode 100644 index 043caf1..0000000 --- a/test/unit/couch_changes_test.rb +++ /dev/null @@ -1,32 +0,0 @@ -require File.expand_path('../../test_helper.rb', __FILE__) -require 'tapicero/couch_changes' - -class CouchChangesTest < MiniTest::Unit::TestCase - - LAST_SEQ = 12 - - def setup - @stream = mock() - @changes = Tapicero::CouchChanges.new(@stream) - end - - def test_last_seq - @stream.expects(:get). - with('_changes', {:limit => 1, :descending => true}). - yields(:last_seq => LAST_SEQ) - assert_equal LAST_SEQ, @changes.last_seq - end - - def test_follow - stub_entry = {:new => :result} - @stream.expects(:get). - with('_changes', {:limit => 1, :descending => true}). - yields(:last_seq => LAST_SEQ) - @stream.expects(:get). - with('_changes', {:feed => :continuous, :since => LAST_SEQ}). - yields(stub_entry) - @changes.follow do |hash| - assert_equal stub_entry, hash - end - end -end diff --git a/test/unit/couch_stream_test.rb b/test/unit/couch_stream_test.rb deleted file mode 100644 index a9de21f..0000000 --- a/test/unit/couch_stream_test.rb +++ /dev/null @@ -1,29 +0,0 @@ -require File.expand_path('../../test_helper.rb', __FILE__) -require 'tapicero/couch_stream' - -class CouchStreamTest < MiniTest::Unit::TestCase - - def setup - @root = "http://server/database" - @stream = Tapicero::CouchStream.new(@root) - @url = @root + "/_changes?a=b&c=d" - @path = "_changes" - @options = {:a => :b, :c => :d} - end - - def test_get - Tapicero::JsonStream.expects(:get). - with(@url, :symbolize_keys => true). - yields(stub_hash = stub) - @stream.get(@path, @options) do |hash| - assert_equal stub_hash, hash - end - end - - # internal - def test_url_creation - assert_equal "http://server/database/", @stream.send(:url_for, "") - assert_equal @url, @stream.send(:url_for, @path, @options) - end - -end |