1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00

Fix tests for a problem occuring with a specific test order.

This commit is contained in:
Lee Hambley 2013-05-28 16:23:47 +02:00
parent c344bc40b2
commit 4d82cf5b1a

View file

@ -5,42 +5,47 @@ module Capistrano
describe Env do
let(:env) { Configuration.env }
let(:env) { Configuration.new }
describe '#role' do
it 'can add a role, with hosts' do
env.role(:app, %w{example.com})
env.roles_for(:app).first.hostname.should == "example.com"
end
it 'handles de-duplification within roles' do
env.role(:app, %w{example.com})
env.role(:app, %w{example.com})
env.roles_for(:app).length.should == 1
end
it 'accepts instances of server objects' do
pending
env.role(:app, [Capistrano::Configuration::Server.new('example.net'), 'example.com'])
env.roles_for(:app).length.should == 2
end
it 'accepts non-enumerable types' do
env.role(:app, 'example.com')
env.roles_for(:app).length.should == 1
end
end
describe '#server' do
it "can create a server with properties" do
env.server('example.com', roles: [:app, "web"], my: :value)
env.roles_for(:app).first.hostname.should == 'example.com'
env.roles_for(:web).first.hostname.should == 'example.com'
env.roles_for(:all).first.properties.my.should == :value
end
end
describe '#roles' do
let(:env) { Configuration.env }
before do
env.server('example.com', roles: :app, active: true)
env.server('example.org', roles: :app)