imager 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,7 +11,7 @@ describe Imager::LinkHelper do
11
11
  correct_link = "http://base_uri/images/testcollection/1/image/small.jpg"
12
12
  result = described_class.link_for("testcollection", "1", "image", :small)
13
13
 
14
- result.should eq correct_link
14
+ expect(result).to eq correct_link
15
15
  end
16
16
  end
17
17
  end
@@ -3,20 +3,20 @@ require 'spec_helper'
3
3
  describe Imager::ServerInterface do
4
4
  let(:some_image){ "spec/image.jpg" }
5
5
  let(:some_image_file) { File.new(some_image) }
6
- let(:some_image_io) { UploadIO.new(some_image_file, "application/octet-stream") }
6
+ let(:some_image_io) { Rack::Test::UploadedFile.new(some_image_file, "application/octet-stream") }
7
7
  describe ".post" do
8
8
 
9
9
  context "when params are valid" do
10
10
  it "returns true" do
11
11
  VCR.use_cassette('valid_post') do
12
- described_class.post("test", "1", some_image, small: { width: 100 }).should be_true
12
+ expect(described_class.post("test", "1", some_image, small: { width: 100 })).to be_truthy
13
13
  end
14
14
  end
15
15
 
16
16
  context "when image is a file" do
17
17
  it "returns true" do
18
18
  VCR.use_cassette('valid_post_with_file') do
19
- described_class.post("test", "1", some_image_file, small: { width: 100 }).should be_true
19
+ expect(described_class.post("test", "1", some_image_file, small: { width: 100 })).to be_truthy
20
20
  end
21
21
  end
22
22
  end
@@ -24,7 +24,7 @@ describe Imager::ServerInterface do
24
24
  context "when image is a IO" do
25
25
  it "returns true" do
26
26
  VCR.use_cassette('valid_post_with_io') do
27
- described_class.post("test", "1", some_image_io, small: { width: 100 }).should be_true
27
+ expect(described_class.post("test", "1", some_image_io, small: { width: 100 })).to be_truthy
28
28
  end
29
29
  end
30
30
  end
@@ -43,7 +43,7 @@ describe Imager::ServerInterface do
43
43
  it "raises an error" do
44
44
  VCR.use_cassette('invalid_album_and_collection_post') do
45
45
  expect {
46
- described_class.post("", "", some_image, size: { width: 100 })
46
+ described_class.post("", "", some_image_io, size: { width: 100 })
47
47
  }.to raise_error Imager::ImagerError
48
48
  end
49
49
  end
@@ -55,10 +55,10 @@ describe Imager::ServerInterface do
55
55
 
56
56
  it "returns true" do
57
57
  VCR.use_cassette('valid_post') do
58
- described_class.post("test", "1", some_image, small: { width: 100 })
58
+ described_class.post("test", "1", some_image_io, small: { width: 100 })
59
59
  end
60
60
  VCR.use_cassette('valid_delete') do
61
- described_class.delete("test", "1", "image").should be_true
61
+ expect(described_class.delete("test", "1", "image")).to be_truthy
62
62
  end
63
63
  end
64
64
  end
@@ -5,7 +5,7 @@ describe Imager do
5
5
 
6
6
  it "yields" do
7
7
  described_class.configure do |c|
8
- c.should be described_class
8
+ expect(c).to be described_class
9
9
  end
10
10
  end
11
11
 
@@ -14,7 +14,7 @@ describe Imager do
14
14
  c.base_uri = "http://baseuri.bla/"
15
15
  end
16
16
 
17
- described_class.base_uri.should eq "http://baseuri.bla/"
17
+ expect(described_class.base_uri).to eq "http://baseuri.bla/"
18
18
  end
19
19
 
20
20
  it "sets manager_path" do
@@ -22,7 +22,7 @@ describe Imager do
22
22
  c.manager_path = "manager_path"
23
23
  end
24
24
 
25
- described_class.manager_path.should eq "manager_path"
25
+ expect(described_class.manager_path).to eq "manager_path"
26
26
  end
27
27
 
28
28
  it "sets collection_path" do
@@ -30,7 +30,7 @@ describe Imager do
30
30
  c.collection_path = "your_collections_path"
31
31
  end
32
32
 
33
- described_class.collection_path.should eq "your_collections_path"
33
+ expect(described_class.collection_path).to eq "your_collections_path"
34
34
  end
35
35
 
36
36
  it "sets auth_code" do
@@ -38,7 +38,7 @@ describe Imager do
38
38
  c.auth_code = "your_auth_code"
39
39
  end
40
40
 
41
- described_class.auth_code.should eq "your_auth_code"
41
+ expect(described_class.auth_code).to eq "your_auth_code"
42
42
  end
43
43
  end
44
44
  end
@@ -2,17 +2,15 @@ require 'imager'
2
2
 
3
3
  #dependencies
4
4
  require 'minitest/autorun'
5
- require 'webmock/minitest'
5
+ require 'webmock/rspec'
6
6
  require 'vcr'
7
7
  require 'turn'
8
-
9
- # Hack for HTTMultiParty And VCR
10
- require 'support/httmultiparty'
8
+ require "rack/test"
11
9
 
12
10
  RSpec.configure do |c|
13
11
  c.before do
14
12
  Imager.configure do |c|
15
- c.base_uri = "http://dev.local/imagerserver"
13
+ c.base_uri = "http://localhost/imagerserver"
16
14
  c.auth_code = "ABCDE"
17
15
  c.collection_path = "images"
18
16
  c.manager_path = "manager"
metadata CHANGED
@@ -1,149 +1,150 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: imager
3
- version: !ruby/object:Gem::Version
4
- hash: 2958535317820123368
5
- prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 5
10
- version: 0.0.5
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.6
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Guilherme Otranto
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2013-06-13 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
11
+ date: 2019-06-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
21
14
  name: bundler
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
26
- - - ~>
27
- - !ruby/object:Gem::Version
28
- hash: 2609263317959306961
29
- segments:
30
- - 1
31
- - 3
32
- version: "1.3"
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.0'
33
20
  type: :development
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: rake
37
21
  prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
39
- none: false
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- hash: 2002549777813010636
44
- segments:
45
- - 0
46
- version: "0"
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '12'
47
34
  type: :development
48
- version_requirements: *id002
49
- - !ruby/object:Gem::Dependency
50
- name: rspec
51
35
  prerelease: false
52
- requirement: &id003 !ruby/object:Gem::Requirement
53
- none: false
54
- requirements:
55
- - - ">="
56
- - !ruby/object:Gem::Version
57
- hash: 2002549777813010636
58
- segments:
59
- - 0
60
- version: "0"
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '12'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.8'
61
48
  type: :development
62
- version_requirements: *id003
63
- - !ruby/object:Gem::Dependency
64
- name: webmock
65
49
  prerelease: false
66
- requirement: &id004 !ruby/object:Gem::Requirement
67
- none: false
68
- requirements:
69
- - - ">="
70
- - !ruby/object:Gem::Version
71
- hash: 2002549777813010636
72
- segments:
73
- - 0
74
- version: "0"
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.8'
55
+ - !ruby/object:Gem::Dependency
56
+ name: webmock
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.6'
75
62
  type: :development
76
- version_requirements: *id004
77
- - !ruby/object:Gem::Dependency
78
- name: vcr
79
63
  prerelease: false
80
- requirement: &id005 !ruby/object:Gem::Requirement
81
- none: false
82
- requirements:
83
- - - ">="
84
- - !ruby/object:Gem::Version
85
- hash: 2002549777813010636
86
- segments:
87
- - 0
88
- version: "0"
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.6'
69
+ - !ruby/object:Gem::Dependency
70
+ name: vcr
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '5.0'
89
76
  type: :development
90
- version_requirements: *id005
91
- - !ruby/object:Gem::Dependency
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '5.0'
83
+ - !ruby/object:Gem::Dependency
92
84
  name: turn
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '0.9'
90
+ type: :development
93
91
  prerelease: false
94
- requirement: &id006 !ruby/object:Gem::Requirement
95
- none: false
96
- requirements:
97
- - - ">="
98
- - !ruby/object:Gem::Version
99
- hash: 2002549777813010636
100
- segments:
101
- - 0
102
- version: "0"
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '0.9'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rack-test
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '1.1'
103
104
  type: :development
104
- version_requirements: *id006
105
- - !ruby/object:Gem::Dependency
106
- name: httmultiparty
107
105
  prerelease: false
108
- requirement: &id007 !ruby/object:Gem::Requirement
109
- none: false
110
- requirements:
111
- - - ~>
112
- - !ruby/object:Gem::Version
113
- hash: 3288670328528004693
114
- segments:
115
- - 0
116
- - 3
117
- - 10
118
- version: 0.3.10
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '1.1'
111
+ - !ruby/object:Gem::Dependency
112
+ name: httparty
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '0.17'
119
118
  type: :runtime
120
- version_requirements: *id007
121
- - !ruby/object:Gem::Dependency
122
- name: json
123
119
  prerelease: false
124
- requirement: &id008 !ruby/object:Gem::Requirement
125
- none: false
126
- requirements:
127
- - - ">="
128
- - !ruby/object:Gem::Version
129
- hash: 2002549777813010636
130
- segments:
131
- - 0
132
- version: "0"
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '0.17'
125
+ - !ruby/object:Gem::Dependency
126
+ name: json
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '2.2'
133
132
  type: :runtime
134
- version_requirements: *id008
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '2.2'
135
139
  description: A remote storange and resizer client for images.
136
- email:
140
+ email:
137
141
  - guilherme_otran@hotmail.com
138
142
  executables: []
139
-
140
143
  extensions: []
141
-
142
144
  extra_rdoc_files: []
143
-
144
- files:
145
- - .gitignore
146
- - .travis.yml
145
+ files:
146
+ - ".gitignore"
147
+ - ".travis.yml"
147
148
  - Gemfile
148
149
  - LICENSE.txt
149
150
  - README.md
@@ -168,39 +169,29 @@ files:
168
169
  - spec/spec_helper.rb
169
170
  - spec/support/httmultiparty.rb
170
171
  homepage: https://github.com/guilherme-otran/Imager
171
- licenses:
172
+ licenses:
172
173
  - MIT
174
+ metadata: {}
173
175
  post_install_message:
174
176
  rdoc_options: []
175
-
176
- require_paths:
177
+ require_paths:
177
178
  - lib
178
- required_ruby_version: !ruby/object:Gem::Requirement
179
- none: false
180
- requirements:
179
+ required_ruby_version: !ruby/object:Gem::Requirement
180
+ requirements:
181
181
  - - ">="
182
- - !ruby/object:Gem::Version
183
- hash: 2002549777813010636
184
- segments:
185
- - 0
186
- version: "0"
187
- required_rubygems_version: !ruby/object:Gem::Requirement
188
- none: false
189
- requirements:
182
+ - !ruby/object:Gem::Version
183
+ version: '0'
184
+ required_rubygems_version: !ruby/object:Gem::Requirement
185
+ requirements:
190
186
  - - ">="
191
- - !ruby/object:Gem::Version
192
- hash: 2002549777813010636
193
- segments:
194
- - 0
195
- version: "0"
187
+ - !ruby/object:Gem::Version
188
+ version: '0'
196
189
  requirements: []
197
-
198
- rubyforge_project:
199
- rubygems_version: 1.8.25
190
+ rubygems_version: 3.0.1
200
191
  signing_key:
201
- specification_version: 3
192
+ specification_version: 4
202
193
  summary: Imager Client API
203
- test_files:
194
+ test_files:
204
195
  - spec/fixtures/imagerserver_cassettes/invalid_album_and_collection_post.yml
205
196
  - spec/fixtures/imagerserver_cassettes/no_image_delete.yml
206
197
  - spec/fixtures/imagerserver_cassettes/valid_delete.yml