elastomer-client 0.7.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.overcommit.yml +5 -0
  3. data/.rubocop.yml +83 -0
  4. data/CHANGELOG.md +8 -0
  5. data/Gemfile +2 -2
  6. data/README.md +1 -1
  7. data/Rakefile +2 -2
  8. data/elastomer-client.gemspec +4 -2
  9. data/lib/elastomer/client.rb +42 -37
  10. data/lib/elastomer/client/bulk.rb +2 -2
  11. data/lib/elastomer/client/cluster.rb +19 -19
  12. data/lib/elastomer/client/delete_by_query.rb +7 -7
  13. data/lib/elastomer/client/docs.rb +81 -24
  14. data/lib/elastomer/client/errors.rb +2 -2
  15. data/lib/elastomer/client/index.rb +65 -29
  16. data/lib/elastomer/client/multi_percolate.rb +127 -0
  17. data/lib/elastomer/client/multi_search.rb +2 -2
  18. data/lib/elastomer/client/nodes.rb +4 -4
  19. data/lib/elastomer/client/percolator.rb +77 -0
  20. data/lib/elastomer/client/repository.rb +7 -7
  21. data/lib/elastomer/client/scroller.rb +14 -14
  22. data/lib/elastomer/client/snapshot.rb +9 -9
  23. data/lib/elastomer/client/template.rb +3 -3
  24. data/lib/elastomer/client/warmer.rb +5 -16
  25. data/lib/elastomer/core_ext/time.rb +1 -1
  26. data/lib/elastomer/middleware/encode_json.rb +5 -5
  27. data/lib/elastomer/middleware/opaque_id.rb +3 -3
  28. data/lib/elastomer/middleware/parse_json.rb +5 -5
  29. data/lib/elastomer/notifications.rb +4 -4
  30. data/lib/elastomer/version.rb +1 -1
  31. data/script/bootstrap +2 -0
  32. data/script/console +5 -5
  33. data/test/assertions.rb +26 -24
  34. data/test/client/bulk_test.rb +111 -111
  35. data/test/client/cluster_test.rb +58 -58
  36. data/test/client/delete_by_query_test.rb +53 -53
  37. data/test/client/docs_test.rb +279 -203
  38. data/test/client/errors_test.rb +1 -1
  39. data/test/client/index_test.rb +143 -109
  40. data/test/client/multi_percolate_test.rb +130 -0
  41. data/test/client/multi_search_test.rb +30 -28
  42. data/test/client/nodes_test.rb +30 -29
  43. data/test/client/percolator_test.rb +52 -0
  44. data/test/client/repository_test.rb +23 -23
  45. data/test/client/scroller_test.rb +40 -40
  46. data/test/client/snapshot_test.rb +15 -15
  47. data/test/client/stubbed_client_test.rb +15 -15
  48. data/test/client/template_test.rb +10 -10
  49. data/test/client/warmer_test.rb +18 -18
  50. data/test/client_test.rb +53 -53
  51. data/test/core_ext/time_test.rb +12 -12
  52. data/test/middleware/encode_json_test.rb +20 -20
  53. data/test/middleware/opaque_id_test.rb +10 -10
  54. data/test/middleware/parse_json_test.rb +14 -14
  55. data/test/notifications_test.rb +32 -32
  56. data/test/test_helper.rb +24 -24
  57. metadata +38 -2
@@ -0,0 +1,130 @@
1
+ require File.expand_path("../../test_helper", __FILE__)
2
+
3
+ describe Elastomer::Client::MultiPercolate do
4
+
5
+ before do
6
+ @name = "elastomer-mpercolate-test"
7
+ @index = $client.index(@name)
8
+
9
+ unless @index.exists?
10
+ @index.create \
11
+ :settings => { "index.number_of_shards" => 1, "index.number_of_replicas" => 0 },
12
+ :mappings => {
13
+ :doc1 => {
14
+ :_source => { :enabled => true }, :_all => { :enabled => false },
15
+ :properties => {
16
+ :title => { :type => "string", :analyzer => "standard" },
17
+ :author => { :type => "string", :index => "not_analyzed" }
18
+ }
19
+ },
20
+ :doc2 => {
21
+ :_source => { :enabled => true }, :_all => { :enabled => false },
22
+ :properties => {
23
+ :title => { :type => "string", :analyzer => "standard" },
24
+ :author => { :type => "string", :index => "not_analyzed" }
25
+ }
26
+ }
27
+ }
28
+
29
+ wait_for_index(@name)
30
+ end
31
+
32
+ @docs = @index.docs
33
+ end
34
+
35
+ after do
36
+ @index.delete if @index.exists?
37
+ end
38
+
39
+ it "performs multi percolate queries" do
40
+ populate!
41
+
42
+ body = [
43
+ '{"percolate" : {"index": "elastomer-mpercolate-test", "type": "doc2"}}',
44
+ '{"doc": {"author": "pea53"}}',
45
+ '{"percolate" : {"index": "elastomer-mpercolate-test", "type": "doc2"}}',
46
+ '{"doc": {"author": "grantr"}}',
47
+ '{"count" : {"index": "elastomer-mpercolate-test", "type": "doc2"}}',
48
+ '{"doc": {"author": "grantr"}}',
49
+ nil
50
+ ]
51
+ body = body.join "\n"
52
+ h = $client.multi_percolate body
53
+ response1, response2, response3 = h["responses"]
54
+ assert_equal ["1", "2"], response1["matches"].map { |match| match["_id"] }.sort
55
+ assert_equal ["1", "3"], response2["matches"].map { |match| match["_id"] }.sort
56
+ assert_equal 2, response3["total"]
57
+ end
58
+
59
+ it "performs multi percolate queries with .mpercolate" do
60
+ populate!
61
+
62
+ body = [
63
+ '{"percolate" : {"index": "elastomer-mpercolate-test", "type": "doc2"}}',
64
+ '{"doc": {"author": "pea53"}}',
65
+ '{"percolate" : {"index": "elastomer-mpercolate-test", "type": "doc2"}}',
66
+ '{"doc": {"author": "grantr"}}',
67
+ '{"count" : {"index": "elastomer-mpercolate-test", "type": "doc2"}}',
68
+ '{"doc": {"author": "grantr"}}',
69
+ nil
70
+ ]
71
+ body = body.join "\n"
72
+ h = $client.mpercolate body
73
+ response1, response2, response3 = h["responses"]
74
+ assert_equal ["1", "2"], response1["matches"].map { |match| match["_id"] }.sort
75
+ assert_equal ["1", "3"], response2["matches"].map { |match| match["_id"] }.sort
76
+ assert_equal 2, response3["total"]
77
+ end
78
+
79
+ it "supports a nice block syntax" do
80
+ populate!
81
+
82
+ h = $client.multi_percolate(:index => @name, :type => "doc2") do |m|
83
+ m.percolate :author => "pea53"
84
+ m.percolate :author => "grantr"
85
+ m.count({ :author => "grantr" })
86
+ end
87
+
88
+ response1, response2, response3 = h["responses"]
89
+ assert_equal ["1", "2"], response1["matches"].map { |match| match["_id"] }.sort
90
+ assert_equal ["1", "3"], response2["matches"].map { |match| match["_id"] }.sort
91
+ assert_equal 2, response3["total"]
92
+ end
93
+
94
+ # rubocop:disable Metrics/MethodLength
95
+ def populate!
96
+ @docs.index \
97
+ :_id => 1,
98
+ :_type => "doc1",
99
+ :title => "the author of gravatar",
100
+ :author => "mojombo"
101
+
102
+ @docs.index \
103
+ :_id => 2,
104
+ :_type => "doc1",
105
+ :title => "the author of resque",
106
+ :author => "defunkt"
107
+
108
+ @docs.index \
109
+ :_id => 1,
110
+ :_type => "doc2",
111
+ :title => "the author of logging",
112
+ :author => "pea53"
113
+
114
+ @docs.index \
115
+ :_id => 2,
116
+ :_type => "doc2",
117
+ :title => "the author of rubber-band",
118
+ :author => "grantr"
119
+
120
+ percolator1 = @index.percolator "1"
121
+ percolator1.create :query => { :match_all => { } }
122
+ percolator2 = @index.percolator "2"
123
+ percolator2.create :query => { :match => { :author => "pea53" } }
124
+ percolator2 = @index.percolator "3"
125
+ percolator2.create :query => { :match => { :author => "grantr" } }
126
+
127
+ @index.refresh
128
+ end
129
+ # rubocop:enable Metrics/MethodLength
130
+ end
@@ -1,27 +1,27 @@
1
- require File.expand_path('../../test_helper', __FILE__)
1
+ require File.expand_path("../../test_helper", __FILE__)
2
2
 
3
3
  describe Elastomer::Client::MultiSearch do
4
4
 
5
5
  before do
6
- @name = 'elastomer-msearch-test'
6
+ @name = "elastomer-msearch-test"
7
7
  @index = $client.index(@name)
8
8
 
9
9
  unless @index.exists?
10
10
  @index.create \
11
- :settings => { 'index.number_of_shards' => 1, 'index.number_of_replicas' => 0 },
11
+ :settings => { "index.number_of_shards" => 1, "index.number_of_replicas" => 0 },
12
12
  :mappings => {
13
13
  :doc1 => {
14
14
  :_source => { :enabled => true }, :_all => { :enabled => false },
15
15
  :properties => {
16
- :title => { :type => 'string', :analyzer => 'standard' },
17
- :author => { :type => 'string', :index => 'not_analyzed' }
16
+ :title => { :type => "string", :analyzer => "standard" },
17
+ :author => { :type => "string", :index => "not_analyzed" }
18
18
  }
19
19
  },
20
20
  :doc2 => {
21
21
  :_source => { :enabled => true }, :_all => { :enabled => false },
22
22
  :properties => {
23
- :title => { :type => 'string', :analyzer => 'standard' },
24
- :author => { :type => 'string', :index => 'not_analyzed' }
23
+ :title => { :type => "string", :analyzer => "standard" },
24
+ :author => { :type => "string", :index => "not_analyzed" }
25
25
  }
26
26
  }
27
27
  }
@@ -36,7 +36,7 @@ describe Elastomer::Client::MultiSearch do
36
36
  @index.delete if @index.exists?
37
37
  end
38
38
 
39
- it 'performs multisearches' do
39
+ it "performs multisearches" do
40
40
  populate!
41
41
 
42
42
  body = [
@@ -54,7 +54,7 @@ describe Elastomer::Client::MultiSearch do
54
54
  assert_equal "2", response2["hits"]["hits"][0]["_id"]
55
55
 
56
56
  body = [
57
- '{}',
57
+ "{}",
58
58
  '{"query" : {"match": {"author" : "grantr"}}}',
59
59
  nil
60
60
  ]
@@ -65,7 +65,7 @@ describe Elastomer::Client::MultiSearch do
65
65
  assert_equal "2", response1["hits"]["hits"][0]["_id"]
66
66
  end
67
67
 
68
- it 'performs multisearches with .msearch' do
68
+ it "performs multisearches with .msearch" do
69
69
  populate!
70
70
 
71
71
  body = [
@@ -83,7 +83,7 @@ describe Elastomer::Client::MultiSearch do
83
83
  assert_equal "2", response2["hits"]["hits"][0]["_id"]
84
84
 
85
85
  body = [
86
- '{}',
86
+ "{}",
87
87
  '{"query" : {"match": {"author" : "grantr"}}}',
88
88
  nil
89
89
  ]
@@ -94,12 +94,12 @@ describe Elastomer::Client::MultiSearch do
94
94
  assert_equal "2", response1["hits"]["hits"][0]["_id"]
95
95
  end
96
96
 
97
- it 'supports a nice block syntax' do
97
+ it "supports a nice block syntax" do
98
98
  populate!
99
99
 
100
100
  h = $client.multi_search do |m|
101
101
  m.search({:query => { :match_all => {}}}, :index => @name, :search_type => :count)
102
- m.search({:query => { :match => { "title" => "author" }}}, :index => @name, :type => 'doc2')
102
+ m.search({:query => { :match => { "title" => "author" }}}, :index => @name, :type => "doc2")
103
103
  end
104
104
 
105
105
  response1, response2 = h["responses"]
@@ -109,7 +109,7 @@ describe Elastomer::Client::MultiSearch do
109
109
 
110
110
  h = @index.multi_search do |m|
111
111
  m.search({:query => { :match_all => {}}}, :search_type => :count)
112
- m.search({:query => { :match => { "title" => "author" }}}, :type => 'doc2')
112
+ m.search({:query => { :match => { "title" => "author" }}}, :type => "doc2")
113
113
  end
114
114
 
115
115
  response1, response2 = h["responses"]
@@ -117,9 +117,9 @@ describe Elastomer::Client::MultiSearch do
117
117
  assert_equal 4, response1["hits"]["total"]
118
118
  assert_equal 2, response2["hits"]["total"]
119
119
 
120
- h = @index.docs('doc1').multi_search do |m|
120
+ h = @index.docs("doc1").multi_search do |m|
121
121
  m.search({:query => { :match_all => {}}}, :search_type => :count)
122
- m.search({:query => { :match => { "title" => "logging" }}}, :type => 'doc2')
122
+ m.search({:query => { :match => { "title" => "logging" }}}, :type => "doc2")
123
123
  end
124
124
 
125
125
  response1, response2 = h["responses"]
@@ -128,31 +128,33 @@ describe Elastomer::Client::MultiSearch do
128
128
  assert_equal 1, response2["hits"]["total"]
129
129
  end
130
130
 
131
+ # rubocop:disable Metrics/MethodLength
131
132
  def populate!
132
133
  @docs.index \
133
134
  :_id => 1,
134
- :_type => 'doc1',
135
- :title => 'the author of gravatar',
136
- :author => 'mojombo'
135
+ :_type => "doc1",
136
+ :title => "the author of gravatar",
137
+ :author => "mojombo"
137
138
 
138
139
  @docs.index \
139
140
  :_id => 2,
140
- :_type => 'doc1',
141
- :title => 'the author of resque',
142
- :author => 'defunkt'
141
+ :_type => "doc1",
142
+ :title => "the author of resque",
143
+ :author => "defunkt"
143
144
 
144
145
  @docs.index \
145
146
  :_id => 1,
146
- :_type => 'doc2',
147
- :title => 'the author of logging',
148
- :author => 'pea53'
147
+ :_type => "doc2",
148
+ :title => "the author of logging",
149
+ :author => "pea53"
149
150
 
150
151
  @docs.index \
151
152
  :_id => 2,
152
- :_type => 'doc2',
153
- :title => 'the author of rubber-band',
154
- :author => 'grantr'
153
+ :_type => "doc2",
154
+ :title => "the author of rubber-band",
155
+ :author => "grantr"
155
156
 
156
157
  @index.refresh
157
158
  end
159
+ # rubocop:enable Metrics/MethodLength
158
160
  end
@@ -1,57 +1,58 @@
1
- require File.expand_path('../../test_helper', __FILE__)
1
+ require File.expand_path("../../test_helper", __FILE__)
2
2
 
3
3
  describe Elastomer::Client::Nodes do
4
4
 
5
- it 'gets info for the node(s)' do
5
+ it "gets info for the node(s)" do
6
6
  h = $client.nodes.info
7
- assert h.key?('cluster_name'), 'the cluster name is returned'
8
- assert_instance_of Hash, h['nodes'], 'the node list is returned'
7
+ assert h.key?("cluster_name"), "the cluster name is returned"
8
+ assert_instance_of Hash, h["nodes"], "the node list is returned"
9
9
  end
10
10
 
11
- it 'gets stats for the node(s)' do
11
+ it "gets stats for the node(s)" do
12
12
  h = $client.nodes.stats
13
- assert_instance_of Hash, h['nodes'], 'the node list is returned'
13
+ assert_instance_of Hash, h["nodes"], "the node list is returned"
14
14
 
15
- node = h['nodes'].values.first
16
- assert node.key?('indices'), 'indices stats are returned'
15
+ node = h["nodes"].values.first
16
+ assert node.key?("indices"), "indices stats are returned"
17
17
  end
18
18
 
19
19
  if es_version_1_x?
20
- it 'fitlers node info' do
21
- h = $client.nodes.info(:info => 'os')
22
- node = h['nodes'].values.first
23
- assert node.key?('os'), 'expected os info to be present'
24
- assert !node.key?('jvm'), 'expected jvm info to be absent'
20
+ it "fitlers node info" do
21
+ h = $client.nodes.info(:info => "os")
22
+ node = h["nodes"].values.first
23
+ assert node.key?("os"), "expected os info to be present"
24
+ assert !node.key?("jvm"), "expected jvm info to be absent"
25
25
 
26
26
  h = $client.nodes.info(:info => %w[jvm process])
27
- node = h['nodes'].values.first
28
- assert node.key?('jvm'), 'expected jvm info to be present'
29
- assert node.key?('process'), 'expected process info to be present'
30
- assert !node.key?('network'), 'expected network info to be absent'
27
+ node = h["nodes"].values.first
28
+ assert node.key?("jvm"), "expected jvm info to be present"
29
+ assert node.key?("process"), "expected process info to be present"
30
+ assert !node.key?("network"), "expected network info to be absent"
31
31
  end
32
32
 
33
- it 'filters node stats' do
34
- h = $client.nodes.stats(:stats => 'http')
35
- node = h['nodes'].values.first
36
- assert node.key?('http'), 'expected http stats to be present'
37
- assert !node.key?('indices'), 'expected indices stats to be absent'
33
+ it "filters node stats" do
34
+ h = $client.nodes.stats(:stats => "http")
35
+ node = h["nodes"].values.first
36
+ assert node.key?("http"), "expected http stats to be present"
37
+ assert !node.key?("indices"), "expected indices stats to be absent"
38
38
  end
39
39
  end
40
40
 
41
- it 'gets the hot threads for the node(s)' do
41
+ it "gets the hot threads for the node(s)" do
42
42
  str = $client.nodes.hot_threads :read_timeout => 2
43
43
  assert_instance_of String, str
44
- assert_match %r/cpu usage by thread/, str
44
+ assert !str.nil?, "expected response to not be nil"
45
+ assert !str.empty?, "expected response to not be empty"
45
46
  end
46
47
 
47
- it 'can be scoped to a single node' do
48
- h = $client.nodes('node-with-no-name').info
49
- assert_empty h['nodes']
48
+ it "can be scoped to a single node" do
49
+ h = $client.nodes("node-with-no-name").info
50
+ assert_empty h["nodes"]
50
51
  end
51
52
 
52
- it 'can be scoped to multiple nodes' do
53
+ it "can be scoped to multiple nodes" do
53
54
  h = $client.nodes(%w[node1 node2 node3]).info
54
- assert_empty h['nodes']
55
+ assert_empty h["nodes"]
55
56
  end
56
57
 
57
58
  end
@@ -0,0 +1,52 @@
1
+ require File.expand_path("../../test_helper", __FILE__)
2
+
3
+ describe Elastomer::Client::Percolator do
4
+
5
+ before do
6
+ @index = $client.index "elastomer-percolator-test"
7
+ @index.delete if @index.exists?
8
+ @docs = @index.docs("docs")
9
+ end
10
+
11
+ after do
12
+ @index.delete if @index.exists?
13
+ end
14
+
15
+ describe "when an index exists" do
16
+ before do
17
+ @index.create(nil)
18
+ wait_for_index(@index_name)
19
+ end
20
+
21
+ it "creates a query" do
22
+ percolator = @index.percolator "1"
23
+ response = percolator.create :query => { :match_all => { } }
24
+ assert response["created"], "Couldn't create the percolator query"
25
+ end
26
+
27
+ it "gets a query" do
28
+ percolator = @index.percolator "1"
29
+ percolator.create :query => { :match_all => { } }
30
+ response = percolator.get
31
+ assert response["found"], "Couldn't find the percolator query"
32
+ end
33
+
34
+ it "deletes a query" do
35
+ percolator = @index.percolator "1"
36
+ percolator.create :query => { :match_all => { } }
37
+ response = percolator.delete
38
+ assert response["found"], "Couldn't find the percolator query"
39
+ end
40
+
41
+ it "checks for the existence of a query" do
42
+ percolator = @index.percolator "1"
43
+ refute percolator.exists?, "Percolator query exists"
44
+ percolator.create :query => { :match_all => { } }
45
+ assert percolator.exists?, "Percolator query does not exist"
46
+ end
47
+
48
+ it "cannot delete all percolators by providing a nil id" do
49
+ assert_raises(ArgumentError) { percolator = @index.percolator nil }
50
+ end
51
+ end
52
+ end
@@ -1,4 +1,4 @@
1
- require File.expand_path('../../test_helper', __FILE__)
1
+ require File.expand_path("../../test_helper", __FILE__)
2
2
 
3
3
  describe Elastomer::Client::Repository do
4
4
 
@@ -9,11 +9,11 @@ describe Elastomer::Client::Repository do
9
9
  skip "To enable snapshot tests, add a path.repo setting to your elasticsearch.yml file."
10
10
  end
11
11
 
12
- @name = 'elastomer-repository-test'
12
+ @name = "elastomer-repository-test"
13
13
  @repo = $client.repository(@name)
14
14
  end
15
15
 
16
- it 'determines if a repo exists' do
16
+ it "determines if a repo exists" do
17
17
  assert_equal false, @repo.exists?
18
18
  assert_equal false, @repo.exist?
19
19
  with_tmp_repo(@name) do
@@ -21,63 +21,63 @@ describe Elastomer::Client::Repository do
21
21
  end
22
22
  end
23
23
 
24
- it 'creates repos' do
24
+ it "creates repos" do
25
25
  response = create_repo(@name)
26
26
  assert_equal true, response["acknowledged"]
27
27
  delete_repo(@name)
28
28
  end
29
29
 
30
- it 'cannot create a repo without a name' do
30
+ it "cannot create a repo without a name" do
31
31
  lambda {
32
32
  create_repo(nil)
33
33
  }.must_raise ArgumentError
34
34
  end
35
35
 
36
- it 'gets repos' do
36
+ it "gets repos" do
37
37
  with_tmp_repo do |repo|
38
38
  response = repo.get
39
39
  refute_nil response[repo.name]
40
40
  end
41
41
  end
42
42
 
43
- it 'gets all repos' do
43
+ it "gets all repos" do
44
44
  with_tmp_repo do |repo|
45
45
  response = $client.repository.get
46
46
  refute_nil response[repo.name]
47
47
  end
48
48
  end
49
49
 
50
- it 'gets repo status' do
50
+ it "gets repo status" do
51
51
  with_tmp_repo do |repo|
52
52
  response = repo.status
53
53
  assert_equal [], response["snapshots"]
54
54
  end
55
55
  end
56
56
 
57
- it 'gets status of all repos' do
57
+ it "gets status of all repos" do
58
58
  response = $client.repository.status
59
59
  assert_equal [], response["snapshots"]
60
60
  end
61
61
 
62
- it 'updates repos' do
62
+ it "updates repos" do
63
63
  with_tmp_repo do |repo|
64
- settings = repo.get[repo.name]['settings']
65
- response = repo.update(:type => 'fs', :settings => settings.merge('compress' => true))
64
+ settings = repo.get[repo.name]["settings"]
65
+ response = repo.update(:type => "fs", :settings => settings.merge("compress" => true))
66
66
  assert_equal true, response["acknowledged"]
67
67
  assert_equal "true", repo.get[repo.name]["settings"]["compress"]
68
68
  end
69
69
  end
70
70
 
71
- it 'cannot update a repo without a name' do
71
+ it "cannot update a repo without a name" do
72
72
  with_tmp_repo do |repo|
73
73
  lambda {
74
- settings = repo.get[repo.name]['settings']
75
- $client.repository.update(:type => 'fs', :settings => settings.merge('compress' => true))
74
+ settings = repo.get[repo.name]["settings"]
75
+ $client.repository.update(:type => "fs", :settings => settings.merge("compress" => true))
76
76
  }.must_raise ArgumentError
77
77
  end
78
78
  end
79
79
 
80
- it 'deletes repos' do
80
+ it "deletes repos" do
81
81
  with_tmp_repo do |repo|
82
82
  response = repo.delete
83
83
  assert_equal true, response["acknowledged"]
@@ -85,26 +85,26 @@ describe Elastomer::Client::Repository do
85
85
  end
86
86
  end
87
87
 
88
- it 'cannot delete a repo without a name' do
88
+ it "cannot delete a repo without a name" do
89
89
  lambda {
90
90
  $client.repository.delete
91
91
  }.must_raise ArgumentError
92
92
  end
93
93
 
94
- it 'gets snapshots' do
94
+ it "gets snapshots" do
95
95
  with_tmp_repo do |repo|
96
96
  response = repo.snapshots.get
97
97
  assert_equal [], response["snapshots"]
98
98
 
99
- create_snapshot(repo, 'test-snapshot')
99
+ create_snapshot(repo, "test-snapshot")
100
100
  response = repo.snapshot.get
101
- assert_equal ['test-snapshot'], response["snapshots"].collect { |info| info["snapshot"] }
101
+ assert_equal ["test-snapshot"], response["snapshots"].collect { |info| info["snapshot"] }
102
102
 
103
- snapshot2 = create_snapshot(repo, 'test-snapshot2')
103
+ snapshot2 = create_snapshot(repo, "test-snapshot2")
104
104
  response = repo.snapshots.get
105
105
  snapshot_names = response["snapshots"].collect { |info| info["snapshot"] }
106
- assert_includes snapshot_names, 'test-snapshot'
107
- assert_includes snapshot_names, 'test-snapshot2'
106
+ assert_includes snapshot_names, "test-snapshot"
107
+ assert_includes snapshot_names, "test-snapshot2"
108
108
  end
109
109
  end
110
110
  end