From 2836e9453618d9cc7dc64cb99651c4e5a40fb11c Mon Sep 17 00:00:00 2001 From: Azul Date: Tue, 4 Feb 2014 10:09:40 +0100 Subject: separate test setup test from actual test --- test/support/integration_test.rb | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 test/support/integration_test.rb (limited to 'test/support') diff --git a/test/support/integration_test.rb b/test/support/integration_test.rb new file mode 100644 index 0000000..58469b9 --- /dev/null +++ b/test/support/integration_test.rb @@ -0,0 +1,30 @@ +module Tapicero + class IntegrationTest < MiniTest::Unit::TestCase + + def create_user + result = database.save_doc :some => :content + raise RuntimeError.new(result.inspect) unless result['ok'] + @user_id = result['id'] + end + + def user_database + host.database(config.options[:db_prefix] + @user_id) + end + + def database + @database ||= host.database(database_name) + end + + def database_name + config.complete_db_name('users') + end + + def host + @host ||= CouchRest.new(config.couch_host) + end + + def config + Tapicero.config + end + end +end -- cgit v1.2.3