couchbase-jruby-client 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/test/test_utils.rb CHANGED
@@ -19,14 +19,6 @@ require File.join(File.dirname(__FILE__), 'setup')
19
19
 
20
20
  class TestUtils < MiniTest::Test
21
21
 
22
- def setup
23
- @mock = start_mock
24
- end
25
-
26
- def teardown
27
- stop_mock(@mock)
28
- end
29
-
30
22
  def test_complex_startkey
31
23
  assert_equal "all_docs?startkey=%5B%22Deadmau5%22%2C%22%22%5D", Couchbase::Utils.build_query("all_docs", :startkey => ["Deadmau5", ""])
32
24
  end
@@ -38,12 +30,11 @@ class TestUtils < MiniTest::Test
38
30
  raise ArgumentError, "cannot accept your object"
39
31
  end
40
32
  end
41
- connection = Couchbase.new(:hostname => @mock.host, :port => @mock.port)
42
33
  assert_raises(Couchbase::Error::ValueFormat) do
43
- connection.set(uniq_id, "foo")
34
+ cb.set(uniq_id, "foo")
44
35
  end
45
36
  begin
46
- connection.set(uniq_id, "foo")
37
+ cb.set(uniq_id, "foo")
47
38
  rescue Couchbase::Error::ValueFormat => ex
48
39
  assert_match /cannot accept your object/, ex.to_s
49
40
  assert_instance_of ArgumentError, ex.inner_exception
data/test/test_version.rb CHANGED
@@ -19,32 +19,22 @@ require File.join(File.dirname(__FILE__), 'setup')
19
19
 
20
20
  class TestVersion < MiniTest::Test
21
21
 
22
- def setup
23
- @mock = start_mock
24
- end
25
-
26
- def teardown
27
- stop_mock(@mock)
28
- end
29
-
30
22
  def test_sync_version
31
- connection = Couchbase.new(:hostname => @mock.host, :port => @mock.port)
32
- ver = connection.version
23
+ ver = cb.version
33
24
  assert ver.is_a?(Hash)
34
- assert_equal @mock.num_nodes, ver.size
25
+ assert_equal 1, ver.size
35
26
  end
36
27
 
37
28
  def test_async_version
38
29
  skip
39
- connection = Couchbase.new(:hostname => @mock.host, :port => @mock.port)
40
30
  ver = {}
41
- connection.run do |conn|
31
+ cb.run do |conn|
42
32
  conn.version do |ret|
43
33
  assert ret.success?
44
34
  ver[ret.node] = ret.value
45
35
  end
46
36
  end
47
- assert_equal @mock.num_nodes, ver.size
37
+ assert_equal 1, ver.size
48
38
  ver.each do |node, v|
49
39
  assert v.is_a?(String)
50
40
  end
data/test/test_view.rb CHANGED
@@ -20,19 +20,12 @@ require File.join(File.dirname(__FILE__), 'setup')
20
20
  class TestView < MiniTest::Test
21
21
 
22
22
  def setup
23
- @mock = start_mock
24
23
  @path = '_design/users/_view/by_age'
25
- @cb = Couchbase.new(:hostname => @mock.host, :port => @mock.port)
26
- @cb.save_design_doc(design_doc)
24
+ cb.save_design_doc(design_doc)
27
25
  { bob: 32, frank: 25, sam: 42, fred: 21 }.each_pair do |name, age|
28
- @cb.set(name, { type: 'user', name: name, age: age })
26
+ cb.set(name, { type: 'user', name: name, age: age })
29
27
  end
30
- @view = Couchbase::View.new(@cb, @path)
31
- end
32
-
33
- def teardown
34
- stop_mock(@mock)
35
- @cb.disconnect
28
+ @view = Couchbase::View.new(cb, @path)
36
29
  end
37
30
 
38
31
  def test_initialize
@@ -70,7 +63,7 @@ class TestView < MiniTest::Test
70
63
  end
71
64
 
72
65
  def test_design_doc_access
73
- assert results = @cb.design_docs['users'].by_age.to_a
66
+ assert results = cb.design_docs['users'].by_age.to_a
74
67
  assert results.first.is_a?(Couchbase::ViewRow)
75
68
  end
76
69
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: couchbase-jruby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Evans
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-13 00:00:00.000000000 Z
11
+ date: 2013-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -25,17 +25,17 @@ dependencies:
25
25
  prerelease: false
26
26
  type: :runtime
27
27
  - !ruby/object:Gem::Dependency
28
- name: atomic
28
+ name: thread_safe
29
29
  version_requirements: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: 1.1.14
33
+ version: 0.1.2
34
34
  requirement: !ruby/object:Gem::Requirement
35
35
  requirements:
36
36
  - - ~>
37
37
  - !ruby/object:Gem::Version
38
- version: 1.1.14
38
+ version: 0.1.2
39
39
  prerelease: false
40
40
  type: :runtime
41
41
  - !ruby/object:Gem::Dependency