summaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/config.yml2
-rw-r--r--test/unit/config_test.rb14
-rw-r--r--test/unit/couch_stream_test.rb5
3 files changed, 19 insertions, 2 deletions
diff --git a/test/unit/config.yml b/test/unit/config.yml
new file mode 100644
index 0000000..725e5af
--- /dev/null
+++ b/test/unit/config.yml
@@ -0,0 +1,2 @@
+database: test-db
+server: test-server
diff --git a/test/unit/config_test.rb b/test/unit/config_test.rb
new file mode 100644
index 0000000..545bedd
--- /dev/null
+++ b/test/unit/config_test.rb
@@ -0,0 +1,14 @@
+require 'test_helper'
+require 'lib/config'
+
+class ConfigTest < MiniTest::Unit::TestCase
+
+ def setup
+ @config = LeapCA::Config.new(File.expand_path("../config.yml", __FILE__))
+ end
+
+ def test_initial_content
+ assert_equal 'test-server', @config.server
+ assert_equal 'test-db', @config.database
+ end
+end
diff --git a/test/unit/couch_stream_test.rb b/test/unit/couch_stream_test.rb
index 5826ad3..438049b 100644
--- a/test/unit/couch_stream_test.rb
+++ b/test/unit/couch_stream_test.rb
@@ -10,7 +10,8 @@ end
class CouchStreamTest < MiniTest::Unit::TestCase
def setup
- @stream = CouchStream.new("http://server/", "database")
+ @config = stub(:server => "http://server", :database => "database")
+ @stream = CouchStream.new(@config)
@url = "http://server/database/_changes?c=d&a=b"
@path = "_changes"
@options = {:a => :b, :c => :d}
@@ -30,5 +31,5 @@ class CouchStreamTest < MiniTest::Unit::TestCase
assert_equal "http://server/database/", @stream.send(:url_for, "")
assert_equal @url, @stream.send(:url_for, @path, @options)
end
-
+
end