TID
Easy to test in the docker container.
Requirements
linux:
$ curl -s http://get.docker.io/ubuntu/ | sudo sh
mac:
$ brew update
$ brew install docker boot2docker
Installation
Add this line to your application's Gemfile:
gem 'tid'
And then execute:
$ bundle
Or install it yourself as:
$ gem install tid
Usage
$ tid init
create spec/tid/Dockerfile
create spec/tid/id_rsa
create spec/tid/id_rsa.pub
example this.
RSpec
spec_helper.rb:
require 'tid'
RSpec.configure do |config|
...
config.include(Tid)
config.before(:all) { Tid.prepare }
config.after(:all) { Tid.clear }
end
foo_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
end
Contributing
- 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)