spec/integration/other_spec.rb in infrataster-0.1.12 vs spec/integration/other_spec.rb in infrataster-0.1.13
- old
+ new
@@ -6,10 +6,14 @@
end
end
describe server(:proxy) do
let(:time) { Time.now }
+ before :all do
+ @before_all_time = Time.now
+ current_server.ssh_exec "echo 'Hello once' > /tmp/test-once-#{@before_all_time.to_i}"
+ end
before do
current_server.ssh_exec "echo 'Hello' > /tmp/test-#{time.to_i}"
end
it "executes a command on the current server" do
result = current_server.ssh_exec("cat /tmp/test-#{time.to_i}")
@@ -17,9 +21,13 @@
end
it "connects to the current server via SSH" do
current_server.ssh do |ssh|
expect(ssh.exec!('echo -n Hello')).to eq('Hello')
end
+ end
+ it "executes a command on the current server in before all block" do
+ result = current_server.ssh_exec("cat /tmp/test-once-#{@before_all_time.to_i}")
+ expect(result.chomp).to eq('Hello once')
end
end