/cigarette

Tiny test tool

Primary LanguageRubyOtherNOASSERTION

DEVELOPMENT STOPPED. EOL.

cigarette - 2.*

Tiny test tool.

For 1.* versions of cigarette, please read this README.

Requirements

You need rubygems installed.

Tested with Ruby:

  • 1.8.7
  • 1.9.2
  • 1.9.3
  • 2.0.0-preview1

Installation

$ gem install cigarette

or, for development:

$ git clone https://github.com/TibshoOT/cigarette.git
$ gem build cigarette.gemspec
$ gem install ./cigarette

Configuration

In order to smoke or run cigarette, you need to create a .cigarette file binary call directory.

For example, you need to test your app in /home/lucky/app:

$ cd /home/lucky/app
$ touch .cigarette
[fill needed options]
$ cigarette

That's it.

.cigarette file (YAML)

At the moment, there is only two options:

Attribute Argument Explanation
each Period between run Time between command run (in second)
command a command to execute This command will be exectued each :each configuration
rvm List of rubies Each ruby will be tested with its own status

Example:

$ cat .cigarette

You could see:

each: 75
command: 'rake test'
rvm:
  - 1.8.7
  - 1.9.3

Or:

each: 10
command: rake test

'rake test' will be executed each 75 seconds with ruby 1.8.7 and ruby 1.9.3 int the first example.

In the second example, if you don't specify rvm attribute, 'rake test' will be executed with your running ruby (system installed ruby if rvm is not setup or configured or rvm current ruby) only. :)

To use rvm: attribute, you have to setup RVM.

Please, follow RVM man instructions here.

Time helper

For each attribute, you can use period helper.

Helper Example Equivalent without helper
second 2.second 2
minute 5.minute 300
hour 1.hour 3600

Example:

$ cat .cigarette

You should see:

each: 2.minute
command: 'rake test'

You can pluralize these helpers (seconds, minutes, hours).

each: 5.hours

Curse interface

You have some shortcuts:

Shortcut Binded key Explanation
Rebuild r Useful to run command again between to run time
Quit q Quit cigarette
Left Left arrow Switch to the left (when you have some rubies)
Right Right arrow Switch to the right (when you have some rubies)

Usage

Go to containing .cigarette file directory and run cigarette:

$ cd your/directory
$ cigarette

Enjoy.

Want a feature ? Problem ?

Open an issue ;)