MySQL plugin for Infrataster
Ruby
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib Add database name option Mar 13, 2017
spec Add database name option Mar 13, 2017
.gitignore Initial commit. May 6, 2014
.rspec Add tests. May 6, 2014
Gemfile Initial commit. May 6, 2014
LICENSE.txt Initial commit. May 6, 2014
README.md Add database name option Mar 13, 2017
Rakefile Add tests. May 6, 2014
infrataster-plugin-mysql.gemspec v0.2.1 Apr 20, 2017

README.md

infrataster-plugin-mysql

Gem Version

MySQL plugin for Infrataster

Installation

Add this line to your Gemfile:

gem 'infrataster-plugin-mysql'

And then add the following line to your spec_helper.rb:

require 'infrataster-plugin-mysql'

Usage

describe server(:db) do
  describe mysql_query('SHOW STATUS') do
    it 'returns positive uptime' do
      row = results.find {|r| r['Variable_name'] == 'Uptime' }
      expect(row['Value'].to_i).to be > 0

      # `results` is an instance of `Mysql2::Result`
      # See: https://github.com/brianmario/mysql2
    end
  end
end

You can specify username, password and database by options passed to Infrataster::Server.define:

Infrataster::Server.define(
  # ...
  mysql: {user: 'app', password: 'app', database: 'myapp'}
)

Contributing

  1. Fork it ( https://github.com/[my-github-username]/infrataster-plugin-mysql/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