spacex 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,62 @@
1
+ require 'spec_helper'
2
+
3
+ describe SPACEX::Payloads do
4
+ context '#info', vcr: { cassette_name: 'payloads/info' } do
5
+ subject do
6
+ SPACEX::Payloads.info
7
+ end
8
+ it 'returns payloads info' do
9
+ expect(subject.first.payload_id).to eq 'FalconSAT-2'
10
+ expect(subject.first.reused).to eq false
11
+ expect(subject.first.customers).to eq ['DARPA']
12
+ expect(subject.first.nationality).to eq 'United States'
13
+ expect(subject.first.manufacturer).to eq 'SSTL'
14
+ expect(subject.first.payload_type).to eq 'Satellite'
15
+ expect(subject.first.payload_mass_kg).to eq 20
16
+ expect(subject.first.payload_mass_lbs).to eq 43
17
+ expect(subject.first.orbit).to eq 'LEO'
18
+ expect(subject.first.orbit_params.reference_system).to eq 'geocentric'
19
+ expect(subject.first.orbit_params.regime).to eq 'low-earth'
20
+ expect(subject.first.orbit_params.longitude).to eq nil
21
+ expect(subject.first.orbit_params.semi_major_axis_km).to eq nil
22
+ expect(subject.first.orbit_params.eccentricity).to eq nil
23
+ expect(subject.first.orbit_params.periapsis_km).to eq 400
24
+ expect(subject.first.orbit_params.apoapsis_km).to eq 500
25
+ expect(subject.first.orbit_params.inclination_deg).to eq 39
26
+ expect(subject.first.orbit_params.period_min).to eq nil
27
+ expect(subject.first.orbit_params.lifespan_years).to eq nil
28
+ end
29
+ end
30
+
31
+ context "#info('RatSat')", vcr: { cassette_name: 'payloads/RatSat' } do
32
+ subject do
33
+ SPACEX::Payloads.info('RatSat')
34
+ end
35
+ it 'return specific payload info' do
36
+ expect(subject.payload_id).to eq 'RatSat'
37
+ expect(subject.reused).to eq false
38
+ expect(subject.customers).to eq ['SpaceX']
39
+ expect(subject.nationality).to eq 'United States'
40
+ expect(subject.manufacturer).to eq 'SpaceX'
41
+ expect(subject.payload_type).to eq 'Satellite'
42
+ expect(subject.payload_mass_kg).to eq 165
43
+ expect(subject.payload_mass_lbs).to eq 363
44
+ expect(subject.orbit).to eq 'LEO'
45
+ expect(subject.orbit_params.apoapsis_km).to eq 638.145
46
+ expect(subject.orbit_params.arg_of_pericenter).to eq 262.0542
47
+ expect(subject.orbit_params.eccentricity).to eq 0.0009194
48
+ expect(subject.orbit_params.epoch).to eq '2008-09-28T22:51:02.000Z'
49
+ expect(subject.orbit_params.inclination_deg).to eq 9.3329
50
+ expect(subject.orbit_params.lifespan_years).to eq nil
51
+ expect(subject.orbit_params.longitude).to eq nil
52
+ expect(subject.orbit_params.mean_anomaly).to eq 98.2248
53
+ expect(subject.orbit_params.mean_motion).to eq 14.79249332
54
+ expect(subject.orbit_params.periapsis_km).to eq 625.256
55
+ expect(subject.orbit_params.period_min).to eq 97.346
56
+ expect(subject.orbit_params.raan).to eq 63.3956
57
+ expect(subject.orbit_params.reference_system).to eq 'geocentric'
58
+ expect(subject.orbit_params.regime).to eq 'low-earth'
59
+ expect(subject.orbit_params.semi_major_axis_km).to eq 7009.836
60
+ end
61
+ end
62
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spacex
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodolfo Bandeira
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-16 00:00:00.000000000 Z
11
+ date: 2018-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -161,8 +161,10 @@ files:
161
161
  - lib/spacex/cores.rb
162
162
  - lib/spacex/dragon_capsules.rb
163
163
  - lib/spacex/endpoint.rb
164
+ - lib/spacex/history.rb
164
165
  - lib/spacex/launches.rb
165
166
  - lib/spacex/missions.rb
167
+ - lib/spacex/payloads.rb
166
168
  - lib/spacex/resource.rb
167
169
  - lib/spacex/roadster.rb
168
170
  - lib/spacex/rockets.rb
@@ -177,12 +179,20 @@ files:
177
179
  - spec/fixtures/spacex/cores/B1041.yml
178
180
  - spec/fixtures/spacex/dragon_capsules/info.yml
179
181
  - spec/fixtures/spacex/dragon_capsules/info/dragon1.yml
182
+ - spec/fixtures/spacex/history/info.yml
183
+ - spec/fixtures/spacex/history/info/4.yml
180
184
  - spec/fixtures/spacex/launches.yml
185
+ - spec/fixtures/spacex/launches/68.yml
181
186
  - spec/fixtures/spacex/launches/all.yml
187
+ - spec/fixtures/spacex/launches/info.yml
182
188
  - spec/fixtures/spacex/launches/latest.yml
183
189
  - spec/fixtures/spacex/launches/next.yml
190
+ - spec/fixtures/spacex/launches/past.yml
191
+ - spec/fixtures/spacex/launches/upcoming.yml
184
192
  - spec/fixtures/spacex/missions/F3364BF.yml
185
193
  - spec/fixtures/spacex/missions/info.yml
194
+ - spec/fixtures/spacex/payloads/RatSat.yml
195
+ - spec/fixtures/spacex/payloads/info.yml
186
196
  - spec/fixtures/spacex/roadster/info.yml
187
197
  - spec/fixtures/spacex/rockets/info.yml
188
198
  - spec/fixtures/spacex/rockets/info/falcon1.yml
@@ -193,8 +203,11 @@ files:
193
203
  - spec/spacex/company_info_spec.rb
194
204
  - spec/spacex/cores_spec.rb
195
205
  - spec/spacex/dragon_capsules_spec.rb
206
+ - spec/spacex/endpoint_spec.rb
207
+ - spec/spacex/history_spec.rb
196
208
  - spec/spacex/launches_spec.rb
197
209
  - spec/spacex/missions_spec.rb
210
+ - spec/spacex/payloads_spec.rb
198
211
  - spec/spacex/roadster_spec.rb
199
212
  - spec/spacex/rockets_spec.rb
200
213
  - spec/spacex/ships_spec.rb
@@ -233,12 +246,20 @@ test_files:
233
246
  - spec/fixtures/spacex/cores/B1041.yml
234
247
  - spec/fixtures/spacex/dragon_capsules/info.yml
235
248
  - spec/fixtures/spacex/dragon_capsules/info/dragon1.yml
249
+ - spec/fixtures/spacex/history/info.yml
250
+ - spec/fixtures/spacex/history/info/4.yml
236
251
  - spec/fixtures/spacex/launches.yml
252
+ - spec/fixtures/spacex/launches/68.yml
237
253
  - spec/fixtures/spacex/launches/all.yml
254
+ - spec/fixtures/spacex/launches/info.yml
238
255
  - spec/fixtures/spacex/launches/latest.yml
239
256
  - spec/fixtures/spacex/launches/next.yml
257
+ - spec/fixtures/spacex/launches/past.yml
258
+ - spec/fixtures/spacex/launches/upcoming.yml
240
259
  - spec/fixtures/spacex/missions/F3364BF.yml
241
260
  - spec/fixtures/spacex/missions/info.yml
261
+ - spec/fixtures/spacex/payloads/RatSat.yml
262
+ - spec/fixtures/spacex/payloads/info.yml
242
263
  - spec/fixtures/spacex/roadster/info.yml
243
264
  - spec/fixtures/spacex/rockets/info.yml
244
265
  - spec/fixtures/spacex/rockets/info/falcon1.yml
@@ -249,8 +270,11 @@ test_files:
249
270
  - spec/spacex/company_info_spec.rb
250
271
  - spec/spacex/cores_spec.rb
251
272
  - spec/spacex/dragon_capsules_spec.rb
273
+ - spec/spacex/endpoint_spec.rb
274
+ - spec/spacex/history_spec.rb
252
275
  - spec/spacex/launches_spec.rb
253
276
  - spec/spacex/missions_spec.rb
277
+ - spec/spacex/payloads_spec.rb
254
278
  - spec/spacex/roadster_spec.rb
255
279
  - spec/spacex/rockets_spec.rb
256
280
  - spec/spacex/ships_spec.rb