Project

tid

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Easy to test in the docker container.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

> 1.3
~> 10.0

Runtime

~> 2.0.0
 Project Readme

TID

Easy to test in the docker container.

ruby gem wercker status

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

  1. Fork it ( https://github.com/linyows/tid/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Author

linyows

License

The MIT License (MIT)