ec2-mini 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/ec2-mini/cli.rb +1 -1
- data/lib/ec2-mini/version.rb +1 -1
- data/spec/lib/cil_spec.rb +17 -8
- metadata +1 -1
data/lib/ec2-mini/cli.rb
CHANGED
@@ -4,7 +4,7 @@ require 'yaml'
|
|
4
4
|
module EC2Mini
|
5
5
|
class CLI
|
6
6
|
|
7
|
-
def initialize(options = nil, config_file =
|
7
|
+
def initialize(options = nil, config_file = nil)
|
8
8
|
@options = options || load_config_file(config_file)
|
9
9
|
|
10
10
|
['access_key_id', 'secret_access_key', 'region'].each do |attribute|
|
data/lib/ec2-mini/version.rb
CHANGED
data/spec/lib/cil_spec.rb
CHANGED
@@ -2,16 +2,25 @@ require 'ec2-mini/cli'
|
|
2
2
|
|
3
3
|
describe EC2Mini::CLI do
|
4
4
|
describe '#initialize' do
|
5
|
-
|
6
|
-
|
5
|
+
it "don't input option is failure" do
|
6
|
+
expect{ EC2Mini::CLI.new({}) }.to raise_error
|
7
|
+
expect{ EC2Mini::CLI.new({ 'access_key_id' => 'access_key_id' }) }.to raise_error
|
8
|
+
end
|
9
|
+
it "inputs option is failure" do
|
10
|
+
expect(
|
11
|
+
EC2Mini::CLI.new({
|
12
|
+
"access_key_id" => "ACCESS_KEY_ID",
|
13
|
+
"secret_access_key" => "SECRET_ACCESS_KEY",
|
14
|
+
"region" => "REGION"
|
15
|
+
}).class
|
16
|
+
).to eq EC2Mini::CLI
|
17
|
+
end
|
18
|
+
it "don't exist config file is failure" do
|
7
19
|
expect{ EC2Mini::CLI.new(nil, '') }.to raise_error
|
8
|
-
end
|
9
20
|
end
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
expect(EC2Mini::CLI.new(nil, "#{ENV['PWD']}/spec/support/.ec2-mini").class).to eq EC2Mini::CLI
|
14
|
-
end
|
21
|
+
it "exists config file is success" do
|
22
|
+
# TODO ENV['PWD']
|
23
|
+
expect(EC2Mini::CLI.new(nil, "#{ENV['PWD']}/spec/support/.ec2-mini").class).to eq EC2Mini::CLI
|
15
24
|
end
|
16
25
|
end
|
17
26
|
end
|