gametel 0.5.9.2 → 0.5.9.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,6 +18,12 @@ Gametel::Navigation.routes = {
18
18
  [ButtonScreen, :normal_id]]
19
19
  }
20
20
 
21
+ Gametel.keystore = {
22
+ :path => 'features/support/debug.keystore',
23
+ :alias => 'androiddebugkey',
24
+ :password => 'android',
25
+ :keystore_password => 'android'
26
+ }
21
27
 
22
28
  Gametel.apk_path = 'features/support/ApiDemos.apk'
23
29
 
data/lib/gametel.rb CHANGED
@@ -23,17 +23,22 @@ module Gametel
23
23
  @apk_path = path
24
24
  end
25
25
 
26
+ def self.keystore=(keystore)
27
+ @keystore = keystore
28
+ end
29
+
26
30
  def self.default_driver
27
31
  @default_driver ||= Gametel::Driver.new
28
32
  end
29
33
 
30
34
  def self.default_server
31
- @default_server ||= Brazenhead::Server.new @apk_path
35
+ options = [@apk_path]
36
+ options << @keystore if @keystore
37
+ @default_server ||= Brazenhead::Server.new *options
32
38
  end
33
39
 
34
- def self.start(activity, keystore=nil)
35
- default_server.start(activity, keystore) if keystore
36
- default_server.start(activity) unless keystore
40
+ def self.start(activity)
41
+ default_server.start(activity)
37
42
  default_driver
38
43
  end
39
44
 
@@ -1,3 +1,3 @@
1
1
  module Gametel
2
- VERSION = "0.5.9.2"
2
+ VERSION = "0.5.9.3"
3
3
  end
@@ -5,6 +5,13 @@ class GametelSampleScreen
5
5
  end
6
6
 
7
7
  describe Gametel do
8
+ let(:server) { double('Brazenhead Server') }
9
+
10
+ before(:each) do
11
+ Gametel.instance_variable_set(:@default_server, nil)
12
+ Gametel.keystore = nil
13
+ Gametel.apk_path = nil
14
+ end
8
15
 
9
16
  it "should initialize the platform to Brazenhead when no other platform is specified" do
10
17
  screen = GametelSampleScreen.new
@@ -16,6 +23,22 @@ describe Gametel do
16
23
  GametelSampleScreen.should respond_to :text
17
24
  GametelSampleScreen.should respond_to :button
18
25
  end
26
+
27
+ it "should use the supplied apk path" do
28
+ Brazenhead::Server.should_receive(:new).with('expected/path/to.apk').and_return(server)
29
+ server.should_receive(:start).with('SomeActivity')
30
+
31
+ Gametel.apk_path = 'expected/path/to.apk'
32
+ Gametel.start 'SomeActivity'
33
+ end
34
+
35
+ it "should use the supplied keystore" do
36
+ Brazenhead::Server.should_receive(:new).with(nil, :keystore => :info).and_return(server)
37
+ server.should_receive(:start).with('SomeActivity')
38
+
39
+ Gametel.keystore = {:keystore => :info}
40
+ Gametel.start 'SomeActivity'
41
+ end
19
42
 
20
43
  context "when using Brazenhead" do
21
44
  let(:screen) { GametelSampleScreen.new }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gametel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.9.2
4
+ version: 0.5.9.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-04-12 00:00:00.000000000 Z
13
+ date: 2013-04-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: brazenhead
@@ -204,12 +204,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
204
204
  - - ! '>='
205
205
  - !ruby/object:Gem::Version
206
206
  version: '0'
207
+ segments:
208
+ - 0
209
+ hash: 4520710427909593083
207
210
  required_rubygems_version: !ruby/object:Gem::Requirement
208
211
  none: false
209
212
  requirements:
210
213
  - - ! '>='
211
214
  - !ruby/object:Gem::Version
212
215
  version: '0'
216
+ segments:
217
+ - 0
218
+ hash: 4520710427909593083
213
219
  requirements: []
214
220
  rubyforge_project:
215
221
  rubygems_version: 1.8.25