riakpb 0.1.6 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,11 +1,11 @@
1
1
  require 'riak'
2
2
 
3
- module Riak
3
+ module Riakpb
4
4
  module Util
5
5
 
6
6
  module Encode
7
7
 
8
- # Construct a Request Message for Riak, which adheres to the following structure:
8
+ # Construct a Request Message for Riakpb, which adheres to the following structure:
9
9
  #
10
10
  # 00 00 00 07 09 0A 01 62 12 01 6B
11
11
  # |----Len---|MC|----Message-----|
@@ -1,4 +1,4 @@
1
- module Riak
1
+ module Riakpb
2
2
  module Util
3
3
  module MessageCode
4
4
  ERROR_RESPONSE = 0
@@ -56,17 +56,17 @@ module Riak
56
56
 
57
57
  RESPONSE_CLASS_FOR = {
58
58
  PING_REQUEST => nil,
59
- GET_CLIENT_ID_REQUEST => Riak::RpbGetClientIdResp,
59
+ GET_CLIENT_ID_REQUEST => Riakpb::RpbGetClientIdResp,
60
60
  SET_CLIENT_ID_REQUEST => nil,
61
- GET_SERVER_INFO_REQUEST => Riak::RpbGetServerInfoResp,
62
- GET_REQUEST => Riak::RpbGetResp,
63
- PUT_REQUEST => Riak::RpbPutResp,
61
+ GET_SERVER_INFO_REQUEST => Riakpb::RpbGetServerInfoResp,
62
+ GET_REQUEST => Riakpb::RpbGetResp,
63
+ PUT_REQUEST => Riakpb::RpbPutResp,
64
64
  DEL_REQUEST => nil,
65
- LIST_BUCKETS_REQUEST => Riak::RpbListBucketsResp,
66
- LIST_KEYS_REQUEST => Riak::RpbListKeysResp,
67
- GET_BUCKET_REQUEST => Riak::RpbGetBucketResp,
65
+ LIST_BUCKETS_REQUEST => Riakpb::RpbListBucketsResp,
66
+ LIST_KEYS_REQUEST => Riakpb::RpbListKeysResp,
67
+ GET_BUCKET_REQUEST => Riakpb::RpbGetBucketResp,
68
68
  SET_BUCKET_REQUEST => nil,
69
- MAP_REDUCE_REQUEST => Riak::RpbMapRedResp
69
+ MAP_REDUCE_REQUEST => Riakpb::RpbMapRedResp
70
70
  }
71
71
  end
72
72
  end
@@ -1,6 +1,6 @@
1
1
  require 'riak'
2
2
 
3
- module Riak
3
+ module Riakpb
4
4
  module Util
5
5
  module Translation
6
6
  def i18n_scope
data/lib/riak.rb CHANGED
@@ -8,14 +8,14 @@ require 'yaml'
8
8
  require 'base64'
9
9
  require 'riak/client_pb'
10
10
 
11
- module Riak
12
- VERSION = '0.1.6'
11
+ module Riakpb
12
+ VERSION = '0.2.0'
13
13
 
14
14
  # Domain objects
15
15
  autoload :I18n, 'riak/i18n'
16
16
  autoload :Client, 'riak/client'
17
17
  autoload :Key, 'riak/key'
18
- autoload :RiakContent, 'riak/riak_content'
18
+ autoload :Content, 'riak/content'
19
19
  autoload :Bucket, 'riak/bucket'
20
20
  autoload :MapReduce, 'riak/map_reduce'
21
21
 
data/load_stocks.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'riak'
2
2
  require 'csv'
3
3
 
4
- client = Riak::Client.new
4
+ client = Riakpb::Client.new
5
5
  bucket = client["goog"]
6
6
 
7
7
  CSV.foreach('goog.csv', :headers => true) do |row|
@@ -1,13 +1,13 @@
1
1
  require File.expand_path("../spec_helper", File.dirname(__FILE__))
2
2
 
3
- describe Riak::Bucket do
3
+ describe Riakpb::Bucket do
4
4
  describe "when directly initializing" do
5
5
  before :each do
6
- @client = Riak::Client.new
6
+ @client = Riakpb::Client.new
7
7
  end
8
8
 
9
9
  it "should default with the client and name, and empty n_val or allow_mult" do
10
- bucket = Riak::Bucket.new(@client, "test")
10
+ bucket = Riakpb::Bucket.new(@client, "test")
11
11
  bucket.client.should == @client
12
12
  bucket.name.should == "test"
13
13
  bucket.n_val.should == nil
@@ -15,14 +15,14 @@ describe Riak::Bucket do
15
15
  end
16
16
 
17
17
  it "should correctly accept an n_val" do
18
- bucket = Riak::Bucket.new(@client, "test")
18
+ bucket = Riakpb::Bucket.new(@client, "test")
19
19
  bucket.n_val = 5
20
20
  bucket.n_val.should be_kind_of(Fixnum)
21
21
  lambda { bucket.n_val="5" }.should raise_error(ArgumentError)
22
22
  end
23
23
 
24
24
  it "should correctly accept an allow_mult" do
25
- bucket = Riak::Bucket.new(@client, "test")
25
+ bucket = Riakpb::Bucket.new(@client, "test")
26
26
  bucket.allow_mult = true
27
27
  bucket.allow_mult.should be_kind_of(TrueClass)
28
28
  bucket.allow_mult = false
@@ -33,16 +33,16 @@ describe Riak::Bucket do
33
33
 
34
34
  describe "when initialized from the Client" do
35
35
  before :each do
36
- @client = Riak::Client.new
36
+ @client = Riakpb::Client.new
37
37
  @client.rpc.stub!(:request).and_return(nil)
38
38
  end
39
39
 
40
40
  it "should have set the properties" do
41
41
  @client.rpc.stub!(:request).with(
42
- Riak::Util::MessageCode::GET_BUCKET_REQUEST,
43
- Riak::RpbGetBucketReq.new(:bucket => "goog")
42
+ Riakpb::Util::MessageCode::GET_BUCKET_REQUEST,
43
+ Riakpb::RpbGetBucketReq.new(:bucket => "goog")
44
44
  ).and_return(
45
- Riak::RpbGetBucketResp.new(
45
+ Riakpb::RpbGetBucketResp.new(
46
46
  { :props => {
47
47
  :allow_mult => false,
48
48
  :n_val => 3
@@ -50,7 +50,7 @@ describe Riak::Bucket do
50
50
  }
51
51
  ))
52
52
  bucket = @client["goog"]
53
- bucket.should be_kind_of(Riak::Bucket)
53
+ bucket.should be_kind_of(Riakpb::Bucket)
54
54
  bucket.client.should == @client
55
55
  bucket.name.should == "goog"
56
56
  bucket.n_val.should == 3
@@ -60,12 +60,12 @@ describe Riak::Bucket do
60
60
 
61
61
  describe "key retrieval" do
62
62
  before :each do
63
- @client = Riak::Client.new
63
+ @client = Riakpb::Client.new
64
64
  @client.rpc.stub!(:request).with(
65
- Riak::Util::MessageCode::GET_BUCKET_REQUEST,
66
- Riak::RpbGetBucketReq.new(:bucket => "goog")
65
+ Riakpb::Util::MessageCode::GET_BUCKET_REQUEST,
66
+ Riakpb::RpbGetBucketReq.new(:bucket => "goog")
67
67
  ).and_return(
68
- Riak::RpbGetBucketResp.new(
68
+ Riakpb::RpbGetBucketResp.new(
69
69
  { :props => {
70
70
  :allow_mult => false,
71
71
  :n_val => 3
@@ -77,10 +77,10 @@ describe Riak::Bucket do
77
77
 
78
78
  it "should list the keys within the bucket" do
79
79
  @client.rpc.stub!(:request).with(
80
- Riak::Util::MessageCode::LIST_KEYS_REQUEST,
81
- Riak::RpbListKeysReq.new(:bucket => "goog")
80
+ Riakpb::Util::MessageCode::LIST_KEYS_REQUEST,
81
+ Riakpb::RpbListKeysReq.new(:bucket => "goog")
82
82
  ).and_return(
83
- Riak::RpbListKeysResp.new(
83
+ Riakpb::RpbListKeysResp.new(
84
84
  { :keys => ["2010-04-12", "2008-01-10", "2006-06-06"],
85
85
  :done => true
86
86
  }
@@ -90,16 +90,16 @@ describe Riak::Bucket do
90
90
 
91
91
  it "should return a key, when requested" do
92
92
  @client.rpc.stub!(:request).with(
93
- Riak::Util::MessageCode::GET_REQUEST,
94
- Riak::RpbGetReq.new(:bucket => "goog", :key => "2010-04-12", :r => nil)
93
+ Riakpb::Util::MessageCode::GET_REQUEST,
94
+ Riakpb::RpbGetReq.new(:bucket => "goog", :key => "2010-04-12", :r => nil)
95
95
  ).and_return(
96
- Riak::RpbGetResp.new(
96
+ Riakpb::RpbGetResp.new(
97
97
  { :content => [],
98
98
  :vclock => ""
99
99
  }
100
100
  ))
101
- @bucket["2010-04-12"].should be_kind_of(Riak::Key)
101
+ @bucket["2010-04-12"].should be_kind_of(Riakpb::Key)
102
102
  end
103
103
  end # describe "key retrieval"
104
104
 
105
- end # Riak::Client
105
+ end # Riakpb::Client
@@ -1,27 +1,27 @@
1
1
  require File.expand_path("../spec_helper", File.dirname(__FILE__))
2
2
 
3
- describe Riak::Client do
3
+ describe Riakpb::Client do
4
4
  describe "when initializing" do
5
5
  it "should default to the local interface on port 8087" do
6
- client = Riak::Client.new
6
+ client = Riakpb::Client.new
7
7
  client.host.should == "127.0.0.1"
8
8
  client.port.should == 8087
9
9
  end
10
10
 
11
11
  it "should accept a host" do
12
- client = Riak::Client.new :host => "riak.basho.com"
12
+ client = Riakpb::Client.new :host => "riak.basho.com"
13
13
  client.host.should == "riak.basho.com"
14
14
  end
15
15
 
16
16
  it "should accept a port" do
17
- client = Riak::Client.new :port => 9000
17
+ client = Riakpb::Client.new :port => 9000
18
18
  client.port.should == 9000
19
19
  end
20
20
  end
21
21
 
22
22
  describe "reconfiguring" do
23
23
  before :each do
24
- @client = Riak::Client.new
24
+ @client = Riakpb::Client.new
25
25
  end
26
26
 
27
27
  describe "setting the host" do
@@ -70,18 +70,18 @@ describe Riak::Client do
70
70
  end
71
71
 
72
72
  it "should reject an integer equal to the maximum client id" do
73
- lambda { @client.client_id = Riak::Client::MAX_CLIENT_ID }.should raise_error(ArgumentError)
73
+ lambda { @client.client_id = Riakpb::Client::MAX_CLIENT_ID }.should raise_error(ArgumentError)
74
74
  end
75
75
 
76
76
  it "should reject an integer larger than the maximum client id" do
77
- lambda { @client.client_id = Riak::Client::MAX_CLIENT_ID + 1 }.should raise_error(ArgumentError)
77
+ lambda { @client.client_id = Riakpb::Client::MAX_CLIENT_ID + 1 }.should raise_error(ArgumentError)
78
78
  end
79
79
  end # describe "setting the client id"
80
80
  end # describe "reconfiguring"
81
81
 
82
82
  describe "sending and receiving protocol buffers" do
83
83
  before :each do
84
- @client = Riak::Client.new
84
+ @client = Riakpb::Client.new
85
85
  @client.rpc.stub!(:status).and_return(true)
86
86
  @client.rpc.stub!(:request).and_return(nil)
87
87
  end
@@ -89,7 +89,7 @@ describe Riak::Client do
89
89
  describe "basic communication with riak node" do
90
90
  it "should send a ping request and return true" do
91
91
  @client.rpc.stub!(:request).with(
92
- Riak::Util::MessageCode::PING_REQUEST
92
+ Riakpb::Util::MessageCode::PING_REQUEST
93
93
  ).and_return('')
94
94
 
95
95
  @client.ping?.should == true
@@ -98,8 +98,8 @@ describe Riak::Client do
98
98
  it "should request the connected riak node's server info and return a Hash" do
99
99
  # test length or content? Need to look at what are considered acceptable values
100
100
  @client.rpc.stub!(:request).with(
101
- Riak::Util::MessageCode::GET_SERVER_INFO_REQUEST
102
- ).and_return(Riak::RpbGetServerInfoResp.new(
101
+ Riakpb::Util::MessageCode::GET_SERVER_INFO_REQUEST
102
+ ).and_return(Riakpb::RpbGetServerInfoResp.new(
103
103
  { :node => "riak@127.0.0.1",
104
104
  :server_version => "0.10.1"
105
105
  }
@@ -115,21 +115,21 @@ describe Riak::Client do
115
115
  describe "bucket retrieval (get)" do
116
116
  it "should send a request to list available bucket names and return a Protobuf::Field::FieldArray" do
117
117
  @client.rpc.stub!(:request).with(
118
- Riak::Util::MessageCode::LIST_BUCKETS_REQUEST
118
+ Riakpb::Util::MessageCode::LIST_BUCKETS_REQUEST
119
119
  ).and_return(
120
- Riak::RpbListBucketsResp.new(
120
+ Riakpb::RpbListBucketsResp.new(
121
121
  { :buckets => ["goog"] }
122
122
  ))
123
123
 
124
124
  @client.buckets.should be_kind_of(Protobuf::Field::FieldArray)
125
125
  end
126
126
 
127
- it "should send a request with the bucket name and return a Riak::Bucket" do
127
+ it "should send a request with the bucket name and return a Riakpb::Bucket" do
128
128
  @client.rpc.stub!(:request).with(
129
- Riak::Util::MessageCode::GET_BUCKET_REQUEST,
130
- Riak::RpbGetBucketReq.new(:bucket => "goog")
129
+ Riakpb::Util::MessageCode::GET_BUCKET_REQUEST,
130
+ Riakpb::RpbGetBucketReq.new(:bucket => "goog")
131
131
  ).and_return(
132
- Riak::RpbGetBucketResp.new(
132
+ Riakpb::RpbGetBucketResp.new(
133
133
  { :props => {
134
134
  :allow_mult => false,
135
135
  :n_val => 3
@@ -137,15 +137,15 @@ describe Riak::Client do
137
137
  }
138
138
  ))
139
139
 
140
- @client.bucket("goog").should be_kind_of(Riak::Bucket)
140
+ @client.bucket("goog").should be_kind_of(Riakpb::Bucket)
141
141
  end
142
142
 
143
143
  it "should send a request to list keys within a bucket and return a Protobuf::Field::FieldArray" do
144
144
  @client.rpc.stub!(:request).with(
145
- Riak::Util::MessageCode::LIST_KEYS_REQUEST,
146
- Riak::RpbListKeysReq.new(:bucket => "goog")
145
+ Riakpb::Util::MessageCode::LIST_KEYS_REQUEST,
146
+ Riakpb::RpbListKeysReq.new(:bucket => "goog")
147
147
  ).and_return(
148
- Riak::RpbListKeysResp.new(
148
+ Riakpb::RpbListKeysResp.new(
149
149
  { :keys => ["2010-04-12", "2008-01-10", "2006-06-06"],
150
150
  :done => true
151
151
  }
@@ -161,21 +161,21 @@ describe Riak::Client do
161
161
  describe "key operations: retrieval (get), send (put) and delete (del)" do
162
162
  before :each do
163
163
  @client.rpc.stub!(:request).with(
164
- Riak::Util::MessageCode::GET_REQUEST,
165
- Riak::RpbGetReq.new(:bucket => "goog", :key => "2010-04-12", :r => nil)
164
+ Riakpb::Util::MessageCode::GET_REQUEST,
165
+ Riakpb::RpbGetReq.new(:bucket => "goog", :key => "2010-04-12", :r => nil)
166
166
  ).and_return(
167
- Riak::RpbGetResp.new(
167
+ Riakpb::RpbGetResp.new(
168
168
  { :content => [],
169
169
  :vclock => ""
170
170
  }
171
171
  ))
172
172
  end
173
173
 
174
- it "should send a request for a bucket/key pair and return a Riak::RpbGetResp" do
175
- @client.get_request("goog", "2010-04-12").should be_kind_of(Riak::RpbGetResp)
174
+ it "should send a request for a bucket/key pair and return a Riakpb::RpbGetResp" do
175
+ @client.get_request("goog", "2010-04-12").should be_kind_of(Riakpb::RpbGetResp)
176
176
  end
177
177
 
178
- it "should have a vclock attribute within Riak::RpbGetResp of that is a String" do
178
+ it "should have a vclock attribute within Riakpb::RpbGetResp of that is a String" do
179
179
  @client.get_request("goog", "2010-04-12").vclock.should be_kind_of(String)
180
180
  end
181
181
  end # describe "key operations and retrieval"
@@ -183,10 +183,10 @@ describe Riak::Client do
183
183
  describe "key operations and retrieval" do
184
184
  before :each do
185
185
  @client.rpc.stub!(:request).with(
186
- Riak::Util::MessageCode::GET_REQUEST,
187
- Riak::RpbGetReq.new(:bucket => "goog", :key => "2010-04-12", :r => nil)
186
+ Riakpb::Util::MessageCode::GET_REQUEST,
187
+ Riakpb::RpbGetReq.new(:bucket => "goog", :key => "2010-04-12", :r => nil)
188
188
  ).and_return(
189
- Riak::RpbGetResp.new(
189
+ Riakpb::RpbGetResp.new(
190
190
  { :content => [],
191
191
  :vclock => ""
192
192
  }
@@ -196,4 +196,4 @@ describe Riak::Client do
196
196
 
197
197
  end # describe "key operations and retrieval"
198
198
  end # describe "basic communication with riak node"
199
- end # Riak::Client
199
+ end # Riakpb::Client
@@ -1,14 +1,14 @@
1
1
  require File.expand_path("../spec_helper", File.dirname(__FILE__))
2
2
 
3
- describe Riak::RiakContent do
3
+ describe Riakpb::Content do
4
4
  describe "when directly initializing" do
5
5
  before :each do
6
- @client = Riak::Client.new
6
+ @client = Riakpb::Client.new
7
7
  @client.rpc.stub!(:request).with(
8
- Riak::Util::MessageCode::GET_BUCKET_REQUEST,
9
- Riak::RpbGetBucketReq.new(:bucket => "goog")
8
+ Riakpb::Util::MessageCode::GET_BUCKET_REQUEST,
9
+ Riakpb::RpbGetBucketReq.new(:bucket => "goog")
10
10
  ).and_return(
11
- Riak::RpbGetBucketResp.new(
11
+ Riakpb::RpbGetBucketResp.new(
12
12
  { :props => {
13
13
  :allow_mult => false,
14
14
  :n_val => 3
@@ -16,11 +16,11 @@ describe Riak::RiakContent do
16
16
  }
17
17
  ))
18
18
  @bucket = @client["goog"]
19
- @key = Riak::Key.new(@bucket, "test")
19
+ @key = Riakpb::Key.new(@bucket, "test")
20
20
  end
21
21
 
22
22
  it "should default with nil attributes and links/usermeta as instances of Set/Hash" do
23
- rcontent = Riak::RiakContent.new(@key)
23
+ rcontent = Riakpb::Content.new(@key)
24
24
  rcontent.key.should == @key
25
25
  rcontent.value.should == nil
26
26
  rcontent.content_type.should == nil
@@ -28,30 +28,30 @@ describe Riak::RiakContent do
28
28
  rcontent.content_encoding.should == nil
29
29
  rcontent.vtag.should == nil
30
30
  rcontent.links.should be_kind_of(Hash)
31
- rcontent.last_mod.should == nil
31
+ rcontent.last_mod.should be_kind_of(Time)
32
32
  rcontent.last_mod_usecs.should == nil
33
33
  rcontent.usermeta.should be_kind_of(Hash)
34
34
  end
35
35
 
36
36
  it "should allow you to set the Key, after initialization" do
37
- rcontent = Riak::RiakContent.new(@key)
37
+ rcontent = Riakpb::Content.new(@key)
38
38
  rcontent.key = @key
39
39
  rcontent.key.should == @key
40
40
  end
41
41
 
42
42
  it "should accept a Key as an argument to new, tying it back to an owner" do
43
- rcontent = Riak::RiakContent.new(@key)
43
+ rcontent = Riakpb::Content.new(@key)
44
44
  rcontent.key.should == @key
45
45
  end
46
46
 
47
47
  it "should serialize into a corresponding Protocol Buffer (RpbContent)" do
48
- rcontent = Riak::RiakContent.new(@key, :value => "Test")
49
- rcontent.to_pb.should be_kind_of(Riak::RpbContent)
48
+ rcontent = Riakpb::Content.new(@key, :value => "Test")
49
+ rcontent.to_pb.should be_kind_of(Riakpb::RpbContent)
50
50
  end
51
51
 
52
- it "should load a Riak::RpbContent instance, returning a matching self, RiakContent" do
53
- rcontent = Riak::RiakContent.new(@key)
54
- rpb_content = Riak::RpbContent.new
52
+ it "should load a Riakpb::RpbContent instance, returning a matching self, Content" do
53
+ rcontent = Riakpb::Content.new(@key)
54
+ rpb_content = Riakpb::RpbContent.new
55
55
  rpb_content.value = "{\"Date\":\"2010-04-12\",\"Open\":567.35,\"High\":574.00,\"Low\":566.22,\"Close\":572.73,\"Volume\":2352400,\"Adj. Close\":572.73}"
56
56
  rpb_content.content_type = "application/json"
57
57
  rpb_content.vtag = "4DNB6Vt0zLl5VJ6P2xx9dc"
@@ -66,10 +66,9 @@ describe Riak::RiakContent do
66
66
  rcontent.content_encoding.should == nil
67
67
  rcontent.vtag.should == "4DNB6Vt0zLl5VJ6P2xx9dc"
68
68
  rcontent.links.should be_kind_of(Hash)
69
- rcontent.last_mod.should == 1274645855
70
- rcontent.last_mod_usecs.should == 968694
69
+ rcontent.last_mod.should == Time.at(1274645855.968694)
71
70
  rcontent.usermeta.should be_kind_of(Hash)
72
71
  end
73
72
 
74
73
  end # describe "when directly initializing"
75
- end # Riak::RiakContent
74
+ end # Riakpb::Content
@@ -1,14 +1,14 @@
1
1
  require File.expand_path("../spec_helper", File.dirname(__FILE__))
2
2
 
3
- describe Riak::Key do
3
+ describe Riakpb::Key do
4
4
  describe "when directly initializing" do
5
5
  before :each do
6
- @client = Riak::Client.new
6
+ @client = Riakpb::Client.new
7
7
  @client.rpc.stub!(:request).with(
8
- Riak::Util::MessageCode::GET_BUCKET_REQUEST,
9
- Riak::RpbGetBucketReq.new(:bucket => "goog")
8
+ Riakpb::Util::MessageCode::GET_BUCKET_REQUEST,
9
+ Riakpb::RpbGetBucketReq.new(:bucket => "goog")
10
10
  ).and_return(
11
- Riak::RpbGetBucketResp.new(
11
+ Riakpb::RpbGetBucketResp.new(
12
12
  { :props => {
13
13
  :allow_mult => false,
14
14
  :n_val => 3
@@ -19,36 +19,36 @@ describe Riak::Key do
19
19
  end
20
20
 
21
21
  it "should default with the bucket and name, and an empty vclock" do
22
- key = Riak::Key.new(@bucket, "test")
22
+ key = Riakpb::Key.new(@bucket, "test")
23
23
  key.bucket.should == @bucket
24
24
  key.name.should == "test"
25
25
  key.vclock.should == nil
26
- key.content.should be_kind_of(Riak::RiakContent)
26
+ key.content.should be_kind_of(Riakpb::Content)
27
27
  end
28
28
 
29
29
  it "should serialize into a Key Protocol Buffer (RpbPutReq)" do
30
30
  @client.rpc.stub!(:request).with(
31
- Riak::Util::MessageCode::GET_REQUEST,
32
- Riak::RpbGetReq.new(:bucket => "goog", :key => "2010-04-12", :r => nil)
31
+ Riakpb::Util::MessageCode::GET_REQUEST,
32
+ Riakpb::RpbGetReq.new(:bucket => "goog", :key => "2010-04-12", :r => nil)
33
33
  ).and_return(
34
- Riak::RpbGetResp.new(
35
- { :content => [Riak::RpbContent.new(:value => "Test")],
34
+ Riakpb::RpbGetResp.new(
35
+ { :content => [Riakpb::RpbContent.new(:value => "Test")],
36
36
  :vclock => "k\xCEa```\xCC`\xCA\x05R,\xACL\xF7^e0%2\xE6\xB12\xC4s\xE6\x1D\xE5\xCB\x02\x00"
37
37
  }
38
38
  ))
39
- key = @bucket["2010-04-12"] # Riak::Key.new(@bucket, "test")
39
+ key = @bucket["2010-04-12"] # Riakpb::Key.new(@bucket, "test")
40
40
  pb_put = key.to_pb_put
41
- pb_put.should be_kind_of(Riak::RpbPutReq)
41
+ pb_put.should be_kind_of(Riakpb::RpbPutReq)
42
42
  pb_put.vclock.should == "k\xCEa```\xCC`\xCA\x05R,\xACL\xF7^e0%2\xE6\xB12\xC4s\xE6\x1D\xE5\xCB\x02\x00"
43
43
  end
44
44
 
45
45
  it "should serialize into a Link Protocol Buffer (RpbLink)" do
46
- key = Riak::Key.new(@bucket, "test")
46
+ key = Riakpb::Key.new(@bucket, "test")
47
47
  pb_link = key.to_pb_link
48
- pb_link.should be_kind_of(Riak::RpbLink)
48
+ pb_link.should be_kind_of(Riakpb::RpbLink)
49
49
  pb_link.bucket.should == "goog"
50
50
  pb_link.key.should == "test"
51
51
  end
52
52
  end # describe "when directly initializing"
53
- end # Riak::Key
53
+ end # Riakpb::Key
54
54