|
98 | 98 | describe '#new' do |
99 | 99 | it 'should create a valid ssh key' do |
100 | 100 | type = "ssh-rsa" |
101 | | - blob = Forgery::Basic.text(:at_least => 372, :at_most => 372) |
102 | | - email = Forgery::Internet.email_address |
| 101 | + blob = Faker::Internet.password(:min_length => 372, :max_length => 372) |
| 102 | + email = Faker::Internet.email |
103 | 103 |
|
104 | 104 | s = Gitolite::SSHKey.new(type, blob, email) |
105 | 105 |
|
|
109 | 109 |
|
110 | 110 | it 'should create a valid ssh key while specifying an owner' do |
111 | 111 | type = "ssh-rsa" |
112 | | - blob = Forgery::Basic.text(:at_least => 372, :at_most => 372) |
113 | | - email = Forgery::Internet.email_address |
114 | | - owner = Forgery::Name.first_name |
| 112 | + blob = Faker::Internet.password(:min_length => 372, :max_length => 372) |
| 113 | + email = Faker::Internet.email |
| 114 | + owner = Faker::Name.first_name |
115 | 115 |
|
116 | 116 | s = Gitolite::SSHKey.new(type, blob, email, owner) |
117 | 117 |
|
|
121 | 121 |
|
122 | 122 | it 'should create a valid ssh key while specifying an owner and location' do |
123 | 123 | type = "ssh-rsa" |
124 | | - blob = Forgery::Basic.text(:at_least => 372, :at_most => 372) |
125 | | - email = Forgery::Internet.email_address |
126 | | - owner = Forgery::Name.first_name |
127 | | - location = Forgery::Name.location |
| 124 | + blob = Faker::Internet.password(:min_length => 372, :max_length => 372) |
| 125 | + email = Faker::Internet.email |
| 126 | + owner = Faker::Name.first_name |
| 127 | + location = Faker::Company.name |
128 | 128 |
|
129 | 129 | s = Gitolite::SSHKey.new(type, blob, email, owner, location) |
130 | 130 |
|
|
138 | 138 | describe '#hash' do |
139 | 139 | it 'should have two hash equalling one another' do |
140 | 140 | type = "ssh-rsa" |
141 | | - blob = Forgery::Basic.text(:at_least => 372, :at_most => 372) |
142 | | - email = Forgery::Internet.email_address |
143 | | - owner = Forgery::Name.first_name |
144 | | - location = Forgery::Name.location |
| 141 | + blob = Faker::Internet.password(:min_length => 372, :max_length => 372) |
| 142 | + email = Faker::Internet.email |
| 143 | + owner = Faker::Name.first_name |
| 144 | + location = Faker::Company.name |
145 | 145 |
|
146 | 146 | hash_test = [owner, location, type, blob, email].hash |
147 | 147 | s = Gitolite::SSHKey.new(type, blob, email, owner, location) |
|
154 | 154 | describe '#filename' do |
155 | 155 | it 'should create a filename that is the <email>.pub' do |
156 | 156 | type = "ssh-rsa" |
157 | | - blob = Forgery::Basic.text(:at_least => 372, :at_most => 372) |
158 | | - email = Forgery::Internet.email_address |
| 157 | + blob = Faker::Internet.password(:min_length => 372, :max_length => 372) |
| 158 | + email = Faker::Internet.email |
159 | 159 |
|
160 | 160 | s = Gitolite::SSHKey.new(type, blob, email) |
161 | 161 |
|
|
164 | 164 |
|
165 | 165 | it 'should create a filename that is the <owner>.pub' do |
166 | 166 | type = "ssh-rsa" |
167 | | - blob = Forgery::Basic.text(:at_least => 372, :at_most => 372) |
168 | | - email = Forgery::Internet.email_address |
169 | | - owner = Forgery::Name.first_name |
| 167 | + blob = Faker::Internet.password(:min_length => 372, :max_length => 372) |
| 168 | + email = Faker::Internet.email |
| 169 | + owner = Faker::Name.first_name |
170 | 170 |
|
171 | 171 | s = Gitolite::SSHKey.new(type, blob, email, owner) |
172 | 172 |
|
|
175 | 175 |
|
176 | 176 | it 'should create a filename that is the <email>.pub' do |
177 | 177 | type = "ssh-rsa" |
178 | | - blob = Forgery::Basic.text(:at_least => 372, :at_most => 372) |
179 | | - email = Forgery::Internet.email_address |
180 | | - location = Forgery::Basic.text(:at_least => 8, :at_most => 15) |
| 178 | + blob = Faker::Internet.password(:min_length => 372, :max_length => 372) |
| 179 | + email = Faker::Internet.email |
| 180 | + location = Faker::Internet.password(:min_length => 8, :max_length => 15) |
181 | 181 |
|
182 | 182 | s = Gitolite::SSHKey.new(type, blob, email, nil, location) |
183 | 183 |
|
|
187 | 187 |
|
188 | 188 | it 'should create a filename that is the <owner>@<location>.pub' do |
189 | 189 | type = "ssh-rsa" |
190 | | - blob = Forgery::Basic.text(:at_least => 372, :at_most => 372) |
191 | | - email = Forgery::Internet.email_address |
192 | | - owner = Forgery::Name.first_name |
193 | | - location = Forgery::Basic.text(:at_least => 8, :at_most => 15) |
| 190 | + blob = Faker::Internet.password(:min_length => 372, :max_length => 372) |
| 191 | + email = Faker::Internet.email |
| 192 | + owner = Faker::Name.first_name |
| 193 | + location = Faker::Internet.password(:min_length => 8, :max_length => 15) |
194 | 194 |
|
195 | 195 | s = Gitolite::SSHKey.new(type, blob, email, owner, location) |
196 | 196 |
|
|
202 | 202 | describe '#to_file' do |
203 | 203 | it 'should write a "valid" SSH public key to the file system' do |
204 | 204 | type = "ssh-rsa" |
205 | | - blob = Forgery::Basic.text(:at_least => 372, :at_most => 372) |
206 | | - email = Forgery::Internet.email_address |
207 | | - owner = Forgery::Name.first_name |
208 | | - location = Forgery::Basic.text(:at_least => 8, :at_most => 15) |
| 205 | + blob = Faker::Internet.password(:min_length => 372, :max_length => 372) |
| 206 | + email = Faker::Internet.email |
| 207 | + owner = Faker::Name.first_name |
| 208 | + location = Faker::Internet.password(:min_length => 8, :max_length => 15) |
209 | 209 |
|
210 | 210 | s = Gitolite::SSHKey.new(type, blob, email, owner, location) |
211 | 211 |
|
|
218 | 218 |
|
219 | 219 | it 'should return the filename written' do |
220 | 220 | type = "ssh-rsa" |
221 | | - blob = Forgery::Basic.text(:at_least => 372, :at_most => 372) |
222 | | - email = Forgery::Internet.email_address |
223 | | - owner = Forgery::Name.first_name |
224 | | - location = Forgery::Basic.text(:at_least => 8, :at_most => 15) |
| 221 | + blob = Faker::Internet.password(:min_length => 372, :max_length => 372) |
| 222 | + email = Faker::Internet.email |
| 223 | + owner = Faker::Name.first_name |
| 224 | + location = Faker::Internet.password(:min_length => 8, :max_length => 15) |
225 | 225 |
|
226 | 226 | s = Gitolite::SSHKey.new(type, blob, email, owner, location) |
227 | 227 | expect(s.to_file(output_dir)).to eq File.join(output_dir, owner, location, s.filename) |
|
232 | 232 | describe '==' do |
233 | 233 | it 'should have two keys equalling one another' do |
234 | 234 | type = "ssh-rsa" |
235 | | - blob = Forgery::Basic.text(:at_least => 372, :at_most => 372) |
236 | | - email = Forgery::Internet.email_address |
| 235 | + blob = Faker::Internet.password(:min_length => 372, :max_length => 372) |
| 236 | + email = Faker::Internet.email |
237 | 237 |
|
238 | 238 | s1 = Gitolite::SSHKey.new(type, blob, email) |
239 | 239 | s2 = Gitolite::SSHKey.new(type, blob, email) |
|
0 commit comments