From 88083a47eb042fd5b3f6cfd9cae1e087bc9fa072 Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 6 Jan 2014 10:05:47 +0100 Subject: add dummy integration test --- Rakefile | 2 +- test/integration/tapicero_test.rb | 4 ++++ test/unit/couch_changes_test.rb | 32 -------------------------------- test/unit/couch_stream_test.rb | 29 ----------------------------- 4 files changed, 5 insertions(+), 62 deletions(-) create mode 100644 test/integration/tapicero_test.rb delete mode 100644 test/unit/couch_changes_test.rb delete mode 100644 test/unit/couch_stream_test.rb diff --git a/Rakefile b/Rakefile index 7293cb2..6137fc1 100644 --- a/Rakefile +++ b/Rakefile @@ -76,7 +76,7 @@ end ## Rake::TestTask.new do |t| - t.pattern = "test/unit/*_test.rb" + t.pattern = "test/*/*_test.rb" end task :default => :test diff --git a/test/integration/tapicero_test.rb b/test/integration/tapicero_test.rb new file mode 100644 index 0000000..b83263a --- /dev/null +++ b/test/integration/tapicero_test.rb @@ -0,0 +1,4 @@ +require File.expand_path('../../test_helper.rb', __FILE__) + +class TapiceroTest < MiniTest::Unit::TestCase +end 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 -- cgit v1.2.3