-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #271 from dljvette/v1.2.1
Release v1.2.1
- Loading branch information
Showing
25 changed files
with
2,684 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ codedeploy-local.*.log | |
deployment/ | ||
.idea/ | ||
.DS_STORE | ||
*.iml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module InstanceAgent | ||
class StringUtils | ||
|
||
def self.underscore(string) | ||
string. | ||
gsub(/([A-Z0-9]+)([A-Z][a-z])/, '\1_\2'). | ||
scan(/[a-z0-9]+|\d+|[A-Z0-9]+[a-z]*/). | ||
join('_').downcase | ||
end | ||
|
||
def self.is_pascal_case(string) | ||
!!(string =~ /^([A-Z][a-z0-9]+)+/) | ||
end | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# frozen_string_literal: true | ||
package_root = File.dirname(File.dirname(__FILE__)) | ||
|
||
require "#{package_root}/vendor/gems/codedeploy-commands-1.0.0/lib/aws/add_service_wrapper" | ||
|
||
RSpec.describe 'add_service_wrapper' do | ||
|
||
# This test is taken from the AwsSdkRubyCodeGenWrapper | ||
# https://code.amazon.com/packages/AwsSdkRubyCodeGenWrapper/blobs/mainline/--/spec/add_service_wrapper_spec.rb | ||
describe '#add_service' do | ||
before(:all) do | ||
@service_file = File.expand_path('../fixtures/sample_service.json', __FILE__) | ||
@api = JSON.parse(File.read(@service_file)) | ||
@svc_class = Aws.add_service('GeneratedService', api: @api) | ||
end | ||
|
||
let(:client) {Aws::GeneratedService::Client.new(stub_responses: true) } | ||
|
||
it 'can create a valid client' do | ||
expect(client).to be_instance_of(Aws::GeneratedService::Client) | ||
end | ||
|
||
it 'can create a client from the returned namespace' do | ||
expect(@svc_class::Client.new(stub_responses: true)) | ||
.to be_instance_of(Aws::GeneratedService::Client) | ||
end | ||
|
||
it 'can set constants on the returned namespace' do | ||
@svc_class.const_set(:VERSION, '1.1.42') | ||
expect(Aws::GeneratedService::VERSION).to eq('1.1.42') | ||
end | ||
|
||
it 'can add plugins to the generated client' do | ||
class MyPlugin; end | ||
Aws::GeneratedService::Client.add_plugin(MyPlugin) | ||
expect(Aws::GeneratedService::Client.plugins).to include(MyPlugin) | ||
end | ||
|
||
it 'can generate a whitelabel (non-Aws) service' do | ||
Aws.add_service('MyService', api: @api, whitelabel: true) | ||
expect(MyService::Client.new(stub_responses: true)) | ||
.to be_instance_of(MyService::Client) | ||
end | ||
|
||
it 'loads the model from a string path' do | ||
Aws.add_service('StringPathService', api: @service_file) | ||
expect(Aws::StringPathService::Client.new(stub_responses: true)) | ||
.to be_instance_of(Aws::StringPathService::Client) | ||
end | ||
|
||
it 'loads the model from a PathName' do | ||
Aws.add_service('PathService', api: Pathname.new(@service_file)) | ||
expect(Aws::PathService::Client.new(stub_responses: true)) | ||
.to be_instance_of(Aws::PathService::Client) | ||
end | ||
|
||
it 'raises an ArgumentError if api is not provided' do | ||
expect do | ||
Aws.add_service('NoApiService') | ||
end.to raise_exception(ArgumentError) | ||
end | ||
end | ||
end |
Oops, something went wrong.