phone_gap-build 0.6.2 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/phone_gap/build/credentials.rb +1 -1
- data/lib/phone_gap/build/version.rb +1 -1
- data/spec/phone_gap/build/credentials_spec.rb +27 -14
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee3545194726a70b62433b235ea33b325669f912
|
4
|
+
data.tar.gz: 12f94bb409194a1c853db2d0442d624447325e1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f99c368c83fcf663466a167e3f79e3cff21b6fd9e2f88bef7db32fe201522e3c3c7dd334a3642f4bc6a56dbb72adc16c8ee732f9978f73c5fbb476889dde7b0
|
7
|
+
data.tar.gz: 27ad1b1463536565610d378316744e924bf677c26ed3f271ecb70b2be8c2179e54e3a2725de27e701b3c87d201fe090aac1fe21f8497865c66c14f36164c703f
|
@@ -6,32 +6,45 @@ describe PhoneGap::Build::Credentials do
|
|
6
6
|
|
7
7
|
describe '#load' do
|
8
8
|
|
9
|
-
let(:config_file) { File.expand_path('config/phonegap.yml', ROOT_DIR) }
|
10
|
-
|
11
|
-
before do
|
12
|
-
File.stub(:exists?).with(config_file).and_return true
|
13
|
-
end
|
14
|
-
|
15
9
|
context 'when run in the context fo bundler' do
|
16
10
|
|
17
11
|
before do
|
18
12
|
ENV.stub(:[]).with('BUNDLE_GEMFILE').and_return(File.join(ROOT_DIR, 'Gemfile'))
|
19
13
|
end
|
20
14
|
|
21
|
-
|
22
|
-
expect(YAML).to receive(:load_file).with(config_file).and_return({})
|
23
|
-
subject.load
|
24
|
-
end
|
15
|
+
context 'and a config file exists' do
|
25
16
|
|
26
|
-
|
17
|
+
let(:config_file) { File.expand_path('config/phonegap.yml', ROOT_DIR) }
|
18
|
+
let(:config_double) { double('config') }
|
19
|
+
let(:erb_double) { double('erb', :result => config_file) }
|
27
20
|
|
28
21
|
before do
|
29
|
-
|
22
|
+
File.stub(:exists?).with(config_file).and_return true
|
23
|
+
File.stub(:read).with(config_file).and_return config_double
|
24
|
+
ERB.stub(:new).with(config_double).and_return erb_double
|
25
|
+
end
|
26
|
+
|
27
|
+
|
28
|
+
it 'evaluates any embedded ruby' do
|
29
|
+
expect(ERB).to receive(:new).with(config_double).and_return erb_double
|
30
|
+
subject.load
|
30
31
|
end
|
31
32
|
|
32
|
-
it '
|
33
|
+
it 'tries to load a phonegap config file' do
|
34
|
+
expect(YAML).to receive(:load).with(config_file).and_return({})
|
33
35
|
subject.load
|
34
|
-
|
36
|
+
end
|
37
|
+
|
38
|
+
context 'if a token exists in config' do
|
39
|
+
|
40
|
+
before do
|
41
|
+
YAML.stub(:load).and_return({'token' => 'BATMAN'})
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'populates the credentials using values from the config file' do
|
45
|
+
subject.load
|
46
|
+
expect(subject.token).to eq 'BATMAN'
|
47
|
+
end
|
35
48
|
end
|
36
49
|
end
|
37
50
|
end
|