three_sixty 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,241 @@
1
+ require File.dirname(__FILE__) + '/spec_helper.rb'
2
+
3
+ module Sorenson
4
+ module ThreeSixty
5
+ describe Uploader, '.getMD5Hash' do
6
+ it 'should o something' do
7
+ @account = Account.new({})
8
+ data = {'pathToAsset' => '/usr/bin/gem'}
9
+ @uploader = Uploader.new(@account, data)
10
+ io = StringIO.new('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.' * 100)
11
+ File.should_receive(:size).with(data['pathToAsset']).and_return(io.size)
12
+ File.should_receive(:open).with(data['pathToAsset']).and_return(io)
13
+ @uploader.getMD5Hash.should == '7b28f3c707ada42dbd63dcf7f50555d5'
14
+ end
15
+ end
16
+
17
+ describe Uploader, '#initialize' do
18
+ before do
19
+ @account = Account.new({})
20
+ end
21
+
22
+
23
+ describe '[custom settings]' do
24
+ before do
25
+ data = {
26
+ 'application' => 'Foo',
27
+ 'frameRate' => '2:2',
28
+ 'width' => 230,
29
+ 'height' => 420,
30
+ 'audioDataRate' => '29000',
31
+ 'videoDataRate' => '13222',
32
+ 'audioBitRateMode' => 'VBR_MONO',
33
+ 'videoBitRateMode' => 'VBR_SINGLE_PASS',
34
+ 'videoDuration' => 10,
35
+ 'fileType' => 'Quicktime',
36
+ 'audioCodec' => 'something',
37
+ 'videoCodec' => 'something',
38
+ 'authorName' => 'something',
39
+ 'sourceFileName' => 'something',
40
+ 'sourceAudioCodec' => 'something',
41
+ 'sourceVideoCodec' => 'something',
42
+ 'sourceFrameRate' => '2:2',
43
+ 'sourceWidth' => 10,
44
+ 'sourceHeight' => 10,
45
+ 'sourceAudioBitRateMode' => 'something',
46
+ 'sourceVideoDataRate' => '13222',
47
+ 'sourceVideoBitRateMode' => 'something'
48
+ }
49
+
50
+ @uploader = Uploader.new(@account, data)
51
+ end
52
+
53
+ it 'should override application' do
54
+ @uploader.application.should == 'Foo'
55
+ end
56
+
57
+ it 'should override frameRate' do
58
+ @uploader.frameRate.should == '2:2'
59
+ end
60
+
61
+ it 'should override width' do
62
+ @uploader.width.should == 230
63
+ end
64
+
65
+ it 'should override height' do
66
+ @uploader.height.should == 420
67
+ end
68
+
69
+ it 'should override audioDataRate' do
70
+ @uploader.audioDataRate.should == '29000'
71
+ end
72
+
73
+ it 'should override videoDataRate' do
74
+ @uploader.videoDataRate.should == '13222'
75
+ end
76
+
77
+ it 'should override audioBitRateMode' do
78
+ @uploader.audioBitRateMode.should == 'VBR_MONO'
79
+ end
80
+
81
+ it 'should override videoBitRateMode' do
82
+ @uploader.videoBitRateMode.should == 'VBR_SINGLE_PASS'
83
+ end
84
+
85
+ it 'should override videoDuration' do
86
+ @uploader.videoDuration.should == 10
87
+ end
88
+
89
+ it 'should override fileType' do
90
+ @uploader.fileType.should == 'Quicktime'
91
+ end
92
+
93
+ it 'should override audioCodec' do
94
+ @uploader.audioCodec.should == 'something'
95
+ end
96
+
97
+ it 'should override videoCodec' do
98
+ @uploader.videoCodec.should == 'something'
99
+ end
100
+
101
+ it 'should override authorName' do
102
+ @uploader.authorName.should == 'something'
103
+ end
104
+
105
+ it 'should override sourceFileName' do
106
+ @uploader.sourceFileName.should == 'something'
107
+ end
108
+
109
+ it 'should override sourceAudioCodec' do
110
+ @uploader.sourceAudioCodec.should == 'something'
111
+ end
112
+
113
+ it 'should override sourceVideoCodec' do
114
+ @uploader.sourceVideoCodec.should == 'something'
115
+ end
116
+
117
+ it 'should override sourceFrameRate' do
118
+ @uploader.sourceFrameRate.should == '2:2'
119
+ end
120
+
121
+ it 'should override sourceWidth' do
122
+ @uploader.sourceWidth.should == 10
123
+ end
124
+
125
+ it 'should override sourceHeight' do
126
+ @uploader.sourceHeight.should == 10
127
+ end
128
+
129
+ it 'should override sourceAudioBitRateMode' do
130
+ @uploader.sourceAudioBitRateMode.should == 'something'
131
+ end
132
+
133
+ it 'should override sourceVideoDataRate' do
134
+ @uploader.sourceVideoDataRate.should == '13222'
135
+ end
136
+
137
+ it 'should override sourceVideoBitRateMode' do
138
+ @uploader.sourceVideoBitRateMode.should == 'something'
139
+ end
140
+
141
+ end
142
+
143
+ describe '[default settings]' do
144
+
145
+ before do
146
+ @uploader = Uploader.new(@account)
147
+ end
148
+
149
+ it 'should set Application' do
150
+ @uploader.application.should == 'Unknown'
151
+ end
152
+
153
+ it 'should set frameRate' do
154
+ @uploader.frameRate.should == '1:1'
155
+ end
156
+
157
+ it 'should set width' do
158
+ @uploader.width.should == 320
159
+ end
160
+
161
+ it 'should set height' do
162
+ @uploader.height.should == 240
163
+ end
164
+
165
+ it 'should set audioDataRate' do
166
+ @uploader.audioDataRate.should == '19000'
167
+ end
168
+
169
+ it 'should set videoDataRate' do
170
+ @uploader.videoDataRate.should == '23222'
171
+ end
172
+
173
+ it 'should set audioBitRateMode' do
174
+ @uploader.audioBitRateMode.should == 'VBR_STEREO'
175
+ end
176
+
177
+ it 'should set videoBitRateMode' do
178
+ @uploader.videoBitRateMode.should == 'VBR_TWO_PASS'
179
+ end
180
+
181
+ it 'should set videoDuration' do
182
+ @uploader.videoDuration.should == 0
183
+ end
184
+
185
+ it 'should set fileType' do
186
+ @uploader.fileType.should == 'Flash'
187
+ end
188
+
189
+ it 'should set audioCodec' do
190
+ @uploader.audioCodec.should == 'unknown'
191
+ end
192
+
193
+ it 'should set videoCodec' do
194
+ @uploader.videoCodec.should == 'unknown'
195
+ end
196
+
197
+ it 'should set authorName' do
198
+ @uploader.authorName.should == 'unknown'
199
+ end
200
+
201
+ it 'should set sourceFileName' do
202
+ @uploader.sourceFileName.should == 'unknown'
203
+ end
204
+
205
+ it 'should set sourceAudioCodec' do
206
+ @uploader.sourceAudioCodec.should == 'unknown'
207
+ end
208
+
209
+ it 'should set sourceVideoCodec' do
210
+ @uploader.sourceVideoCodec.should == 'unknown'
211
+ end
212
+
213
+ it 'should set sourceFrameRate' do
214
+ @uploader.sourceFrameRate.should == '1:1'
215
+ end
216
+
217
+ it 'should set sourceWidth' do
218
+ @uploader.sourceWidth.should == 0
219
+ end
220
+
221
+ it 'should set sourceHeight' do
222
+ @uploader.sourceHeight.should == 0
223
+ end
224
+
225
+ it 'should set sourceAudioBitRateMode' do
226
+ @uploader.sourceAudioBitRateMode.should == 'unknown'
227
+ end
228
+
229
+ it 'should set sourceVideoDataRate' do
230
+ @uploader.sourceVideoDataRate.should == '23222'
231
+ end
232
+
233
+ it 'should set sourceVideoBitRateMode' do
234
+ @uploader.sourceVideoBitRateMode.should == 'unknown'
235
+ end
236
+
237
+ end
238
+
239
+ end
240
+ end
241
+ end
data/tasks/rspec.rake ADDED
@@ -0,0 +1,7 @@
1
+ require 'rubygems'
2
+ require 'spec/rake/spectask'
3
+
4
+ Spec::Rake::SpecTask.new(:spec) do |t|
5
+ t.spec_opts = ['--options', "spec/spec.opts"]
6
+ t.spec_files = FileList['spec/**/*_spec.rb']
7
+ end
@@ -0,0 +1,36 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{three_sixty}
5
+ s.version = "1.0.0"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Sorenson Media"]
9
+ s.date = %q{2010-03-22}
10
+ s.description = %q{Ruby bindings for Sorenson 360 Backend}
11
+ s.email = %q{video@sorensonmedia.com}
12
+ s.extra_rdoc_files = ["CHANGELOG", "README", "lib/sorenson/threesixty.rb", "lib/sorenson/threesixty/account.rb", "lib/sorenson/threesixty/account_summary.rb", "lib/sorenson/threesixty/asset.rb", "lib/sorenson/threesixty/asset_metrics.rb", "lib/sorenson/threesixty/base.rb", "lib/sorenson/threesixty/format_constraint.rb", "lib/sorenson/threesixty/rate_plan.rb", "lib/sorenson/threesixty/subaccount.rb", "lib/sorenson/threesixty/uploader.rb", "tasks/rspec.rake"]
13
+ s.files = ["CHANGELOG", "README", "Rakefile", "lib/sorenson/threesixty.rb", "lib/sorenson/threesixty/account.rb", "lib/sorenson/threesixty/account_summary.rb", "lib/sorenson/threesixty/asset.rb", "lib/sorenson/threesixty/asset_metrics.rb", "lib/sorenson/threesixty/base.rb", "lib/sorenson/threesixty/format_constraint.rb", "lib/sorenson/threesixty/rate_plan.rb", "lib/sorenson/threesixty/subaccount.rb", "lib/sorenson/threesixty/uploader.rb", "spec/account_spec.rb", "spec/account_summary_spec.rb", "spec/asset_metrics_spec.rb", "spec/asset_spec.rb", "spec/base_spec.rb", "spec/format_constraint_spec.rb", "spec/rate_plan_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "spec/uploader_spec.rb", "tasks/rspec.rake", "Manifest", "three_sixty.gemspec"]
14
+ s.homepage = %q{https://github.com/sorenson/ThreeSixtyServices-Internal}
15
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Three_sixty", "--main", "README"]
16
+ s.require_paths = ["lib"]
17
+ s.rubyforge_project = %q{three_sixty}
18
+ s.rubygems_version = %q{1.3.5}
19
+ s.summary = %q{Ruby bindings for Sorenson 360 Backend}
20
+
21
+ if s.respond_to? :specification_version then
22
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
23
+ s.specification_version = 3
24
+
25
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
26
+ s.add_development_dependency(%q<echoe>, [">= 0"])
27
+ s.add_development_dependency(%q<rspec>, [">= 0"])
28
+ else
29
+ s.add_dependency(%q<echoe>, [">= 0"])
30
+ s.add_dependency(%q<rspec>, [">= 0"])
31
+ end
32
+ else
33
+ s.add_dependency(%q<echoe>, [">= 0"])
34
+ s.add_dependency(%q<rspec>, [">= 0"])
35
+ end
36
+ end
metadata ADDED
@@ -0,0 +1,116 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: three_sixty
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Sorenson Media
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2010-03-22 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: echoe
17
+ type: :development
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: rspec
27
+ type: :development
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: "0"
34
+ version:
35
+ description: Ruby bindings for Sorenson 360 Backend
36
+ email: video@sorensonmedia.com
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files:
42
+ - CHANGELOG
43
+ - README
44
+ - lib/sorenson/threesixty.rb
45
+ - lib/sorenson/threesixty/account.rb
46
+ - lib/sorenson/threesixty/account_summary.rb
47
+ - lib/sorenson/threesixty/asset.rb
48
+ - lib/sorenson/threesixty/asset_metrics.rb
49
+ - lib/sorenson/threesixty/base.rb
50
+ - lib/sorenson/threesixty/format_constraint.rb
51
+ - lib/sorenson/threesixty/rate_plan.rb
52
+ - lib/sorenson/threesixty/subaccount.rb
53
+ - lib/sorenson/threesixty/uploader.rb
54
+ - tasks/rspec.rake
55
+ files:
56
+ - CHANGELOG
57
+ - README
58
+ - Rakefile
59
+ - lib/sorenson/threesixty.rb
60
+ - lib/sorenson/threesixty/account.rb
61
+ - lib/sorenson/threesixty/account_summary.rb
62
+ - lib/sorenson/threesixty/asset.rb
63
+ - lib/sorenson/threesixty/asset_metrics.rb
64
+ - lib/sorenson/threesixty/base.rb
65
+ - lib/sorenson/threesixty/format_constraint.rb
66
+ - lib/sorenson/threesixty/rate_plan.rb
67
+ - lib/sorenson/threesixty/subaccount.rb
68
+ - lib/sorenson/threesixty/uploader.rb
69
+ - spec/account_spec.rb
70
+ - spec/account_summary_spec.rb
71
+ - spec/asset_metrics_spec.rb
72
+ - spec/asset_spec.rb
73
+ - spec/base_spec.rb
74
+ - spec/format_constraint_spec.rb
75
+ - spec/rate_plan_spec.rb
76
+ - spec/spec.opts
77
+ - spec/spec_helper.rb
78
+ - spec/uploader_spec.rb
79
+ - tasks/rspec.rake
80
+ - Manifest
81
+ - three_sixty.gemspec
82
+ has_rdoc: true
83
+ homepage: https://github.com/sorenson/ThreeSixtyServices-Internal
84
+ licenses: []
85
+
86
+ post_install_message:
87
+ rdoc_options:
88
+ - --line-numbers
89
+ - --inline-source
90
+ - --title
91
+ - Three_sixty
92
+ - --main
93
+ - README
94
+ require_paths:
95
+ - lib
96
+ required_ruby_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: "0"
101
+ version:
102
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: "1.2"
107
+ version:
108
+ requirements: []
109
+
110
+ rubyforge_project: three_sixty
111
+ rubygems_version: 1.3.5
112
+ signing_key:
113
+ specification_version: 3
114
+ summary: Ruby bindings for Sorenson 360 Backend
115
+ test_files: []
116
+