diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/adapters/couch_db.rb | 15 | ||||
-rw-r--r-- | test/unit/adapters/local_test.rb | 5 | ||||
-rw-r--r-- | test/unit/couch_db/source_unit_test.rb | 11 |
3 files changed, 11 insertions, 20 deletions
diff --git a/test/unit/adapters/couch_db.rb b/test/unit/adapters/couch_db.rb deleted file mode 100644 index 339e4f4..0000000 --- a/test/unit/adapters/couch_db.rb +++ /dev/null @@ -1,15 +0,0 @@ -require 'testhelper' -require 'nickserver/adapters/couch_db' - -class Nickserver::Adapters::CouchDBTest < Minitest::Test - - def test_query_404 - adapter.query(nil) do |status, content| - assert_equal 404, status - end - end - - def adapter - @adapter ||= Nickserver::Adapters::CouchDB.new - end -end diff --git a/test/unit/adapters/local_test.rb b/test/unit/adapters/local_test.rb deleted file mode 100644 index 97d394f..0000000 --- a/test/unit/adapters/local_test.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'test_helper' -require 'nickserver/adapters/local' - -class Nickserver::Adapters::LocalTest < Minitest::Test -end diff --git a/test/unit/couch_db/source_unit_test.rb b/test/unit/couch_db/source_unit_test.rb index fd07808..e5a4f43 100644 --- a/test/unit/couch_db/source_unit_test.rb +++ b/test/unit/couch_db/source_unit_test.rb @@ -12,5 +12,16 @@ module Nickserver::CouchDB Source.new(adapter).query address adapter.verify end + + def test_401 + address = "nick@domain.tl" + adapter = Minitest::Mock.new + adapter.expect :get, [401, nil], + [String, {query: { reduce: "false", key: "\"#{address}\"" }}] + assert_raises Error do + Source.new(adapter).query address + end + adapter.verify + end end end |