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.
@@ -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|
@@ -1,3 +1,3 @@
1
1
  module EC2Mini
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -2,16 +2,25 @@ require 'ec2-mini/cli'
2
2
 
3
3
  describe EC2Mini::CLI do
4
4
  describe '#initialize' do
5
- context 'not exist config file' do
6
- it "is failure" do
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
- context 'exist config file' do
11
- it "is success" do
12
- # TODO ENV['PWD']
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ec2-mini
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: