TID
Easy to test in the docker container.
Requirements
linux:
$ curl -s http://get.docker.io/ubuntu/ | sudo shmac:
$ brew update
$ brew install docker boot2dockerInstallation
Add this line to your application's Gemfile:
gem 'tid'And then execute:
$ bundleOr install it yourself as:
$ gem install tidUsage
$ tid init
create spec/tid/Dockerfile
create spec/tid/id_rsa
create spec/tid/id_rsa.pubexample this.
RSpec
spec_helper.rb:
require 'tid'
RSpec.configure do |config|
...
config.include(Tid)
config.before(:all) { Tid.prepare }
config.after(:all) { Tid.clear }
endfoo_spec.rb:
describe 'ssh to docker container' do
it 'successful' do
out, _, ex = cmd "ssh root@#{ENV['TID_HOSTNAME']} -p #{ENV['TID_PORT']} \
-i #{ENV['TID_BASE_PATH']}/id_rsa 'echo yo'"
expect(ex.exitstatus).to eq 0
expect(out).to eq "yo\n"
end
endContributing
- Fork it ( https://github.com/linyows/tid/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Author
License
The MIT License (MIT)