Coder Social home page Coder Social logo

pythe / nyan-cat-formatter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mattsears/nyan-cat-formatter

0.0 0.0 0.0 9.33 MB

Nyan Cat inspired RSpec formatter!

Home Page: http://mattsears.com/articles/2011/11/16/nyan-cat-rspec-formatter

License: MIT License

Ruby 100.00%

nyan-cat-formatter's Introduction

Nyan Cat RSpec Formatter Build Status

NYAN

This is my take on the Nyan Cat RSpec Formatter. It simply creates a rainbow trail of test results. It also counts the number of examples as they execute and highlights failed and pending specs.

The rainbow changes colors as it runs. See it in action here.

Works with RSpec 1.3, 2 and 3.

Using Nyan Cat

You can either specify the formatting when using the rspec command:

rspec --format NyanCatFormatter

Or add --format NyanCatFormatter to a .rspec file placed in your project's root directory, so that you won't have to specify the --format option everytime you run the command.

###Using with Bundler

To use Nyan Cat with a project that uses Bundler (Rails or Sinatra f.e.) you need to add Nyan Cat dependecy to your Gemfile:

group :test do
  gem "nyan-cat-formatter"
end

And then run bundle install.

Installing it

$ gem install nyan-cat-formatter

If you want to use Nyan Cat as your default formatter, simply put the options in your .rspec file:

--format NyanCatFormatter

Playing the Nyan Cat song

You can then enjoy playback in two ways:

1. Play the song only when desired using a command line option:

Use the following command to run your specs:

$ rspec spec -f NyanCatMusicFormatter

And enjoy the site of Nyan Cat running across your terminal to the Nyan Cat song!

2. Play the song by default when you run your specs:

Make sure your .rspec file in your application's root directory contains the following:

--color
--format NyanCatMusicFormatter

Then run rspec spec and enjoy Nyan Cat formatted text output accompanied by the Nyan Cat song by default!

This currently only works on Mac OS X or on Linux (if you have mpg321 or mpg123 installed).

Using the Nyan Cat Wide Formatter

The classic Nyan Cat Formatter uses a terminal column per test. One test, and single step that the cat goes ahead. The Nyan Cat Wide Formatter, instead, uses the whole terminal width, so the cat will always end up reaching the end of the terminal.

Simple use it by configuring it as the RSpec formatter:

--format NyanCatWideFormatter

Contributing

Once you've made your great commits:

  1. Fork Nyan Cat
  2. Create a topic branch - git checkout -b my_branch
  3. Push to your branch - git push origin my_branch
  4. Create a Pull Request from your branch
  5. That's it!

Author

Matt Sears :: @mattsears

nyan-cat-formatter's People

Contributors

albertbellonch avatar banzaiman avatar blackxored avatar czarneckid avatar dinduks avatar docwhat avatar edgibbs avatar firefly21 avatar gonzih avatar jonrowe avatar kmcphillips avatar kyanny avatar malditogeek avatar mattsears avatar parndt avatar pawurb avatar phallguy avatar philipmw avatar pinglamb avatar rewinfrey avatar rgould avatar serabe avatar sferik avatar tpickett66 avatar unimatrixzxero avatar wyattisimo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.