This repository has been archived by the owner on Dec 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Igor Rzegocki
committed
Apr 14, 2016
1 parent
79d2d64
commit ff85e4f
Showing
5 changed files
with
90 additions
and
0 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
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,18 @@ | ||
# frozen_string_literal: true | ||
require 'spec_helper' | ||
|
||
describe Drivers::Appserver::Factory do | ||
it 'raises error when unknown adapter is present' do | ||
expect do | ||
described_class.build( | ||
aws_opsworks_app, | ||
'deploy' => { aws_opsworks_app['shortname'] => { 'appserver' => { 'adapter' => 'tornado' } } } | ||
) | ||
end.to raise_error StandardError, 'There is no supported Appserver driver for given configuration.' | ||
end | ||
|
||
it 'returns a Unicorn class' do | ||
appserver = described_class.build(aws_opsworks_app, node) | ||
expect(appserver).to be_instance_of(Drivers::Appserver::Unicorn) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# frozen_string_literal: true | ||
require 'spec_helper' | ||
|
||
describe Drivers::Appserver::Unicorn do | ||
it 'receives and exposes app and node' do | ||
driver = described_class.new(aws_opsworks_app, node) | ||
|
||
expect(driver.app).to eq aws_opsworks_app | ||
expect(driver.node).to eq node | ||
expect(driver.options).to eq({}) | ||
end | ||
|
||
it 'returns proper out data' do | ||
expect(described_class.new(aws_opsworks_app, node).out).to eq( | ||
worker_processes: 8, | ||
delay: 3 | ||
) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# frozen_string_literal: true | ||
require 'spec_helper' | ||
|
||
describe Drivers::Framework::Factory do | ||
it 'raises error when unknown adapter is present' do | ||
expect do | ||
described_class.build( | ||
aws_opsworks_app, | ||
'deploy' => { aws_opsworks_app['shortname'] => { 'framework' => { 'adapter' => 'django' } } } | ||
) | ||
end.to raise_error StandardError, 'There is no supported Framework driver for given configuration.' | ||
end | ||
|
||
it 'returns a Rails class' do | ||
framework = described_class.build(aws_opsworks_app, node) | ||
expect(framework).to be_instance_of(Drivers::Framework::Rails) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# frozen_string_literal: true | ||
require 'spec_helper' | ||
|
||
describe Drivers::Framework::Rails do | ||
it 'receives and exposes app and node' do | ||
driver = described_class.new(aws_opsworks_app, node) | ||
|
||
expect(driver.app).to eq aws_opsworks_app | ||
expect(driver.node).to eq node | ||
expect(driver.options).to eq({}) | ||
end | ||
|
||
it 'returns proper out data' do | ||
expect(described_class.new(aws_opsworks_app, node).out).to eq( | ||
deploy_environment: { 'RAILS_ENV' => 'production' }, | ||
migration_command: 'rake db:migrate', | ||
migrate: false | ||
) | ||
end | ||
end |