From 8a81429f0eb8aa5041d47557d0c5b5359bb959e6 Mon Sep 17 00:00:00 2001 From: Azul Date: Wed, 25 May 2016 13:13:30 +0200 Subject: copy over all files from rewritten attempt I started a nickserver from scratch to implement the things that are independent of our choice of stack (eventmachine or other). This commit copies them over and tests both things in parallel. --- test/integration/couch_db/source_test.rb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 test/integration/couch_db/source_test.rb (limited to 'test/integration/couch_db') diff --git a/test/integration/couch_db/source_test.rb b/test/integration/couch_db/source_test.rb new file mode 100644 index 0000000..9e319f4 --- /dev/null +++ b/test/integration/couch_db/source_test.rb @@ -0,0 +1,29 @@ +require 'test_helper' +require 'file_content' +require 'nickserver/couch_db/source' + +module Nickserver::CouchDB + class SourceTest < Minitest::Test + include FileContent + + class TestAdapter + def initialize(status, content) + @status = status + @content = content + end + + def get(url, opts) + yield @status, @content + end + end + + def test_couch_query_and_response + adapter = TestAdapter.new 200, file_content(:blue_couchdb_result) + source = Source.new adapter + source.query 'blue@example.org' do |response| + assert_equal 200, response.status + assert_equal file_content(:blue_nickserver_result), response.content + end + end + end +end -- cgit v1.2.3