Permalink
Browse files

Initial commit

  • Loading branch information...
0 parents commit aaa34ba36dfaeb21afe2f4e4b0e336600eb69e5e Robert Pitts and Tim Pope committed with Hashrocket Workstation Mar 31, 2011
Showing with 87 additions and 0 deletions.
  1. +4 −0 .gitignore
  2. +4 −0 Gemfile
  3. +14 −0 README.markdown
  4. +2 −0 Rakefile
  5. +1 −0 lib/test-align-centaur.rb
  6. +39 −0 lib/test_align_centaur.rb
  7. +23 −0 test-align-centaur.gemspec
@@ -0,0 +1,4 @@
+*.gem
+.bundle
+Gemfile.lock
+pkg/*
@@ -0,0 +1,4 @@
+source "http://rubygems.org"
+
+# Specify your gem's dependencies in test-align-centaur.gemspec
+gemspec
@@ -0,0 +1,14 @@
+test-align: centaur;
+====================
+
+Tired of a boring old line of dots when running your RSpec suite? Fear no
+more, as [`text-align: centaur;`](http://textaligncentaur.com) has been ported
+to RSpec in the form of `test-align: centaur;`.
+
+Usage
+-----
+
+ $ gem install test-align-centaur
+ $ rspec -f TestAlignCentaur
+
+ $ echo '--formatter TestAlignCentaur' >> ~/.rspec
@@ -0,0 +1,2 @@
+require 'bundler'
+Bundler::GemHelper.install_tasks
@@ -0,0 +1 @@
+require 'test_align_centaur'
@@ -0,0 +1,39 @@
+require 'centaur'
+require 'rspec/core/formatters/base_text_formatter'
+
+class TestAlignCentaur < RSpec::Core::Formatters::BaseTextFormatter
+
+ def print(arg)
+ if @centaur.nil?
+ @centaur = String::CENTAUR.chomp
+ elsif @centaur.empty?
+ @centaur = "\n" + String::CENTAUR.chomp
+ end
+ while char = @centaur.slice!(0)
+ break if char == 'x'
+ output.print(char)
+ end
+ output.print(arg)
+ end
+
+ def example_passed(example)
+ super(example)
+ print green('.')
+ end
+
+ def example_pending(example)
+ super(example)
+ print yellow('*')
+ end
+
+ def example_failed(example)
+ super(example)
+ print red('F')
+ end
+
+ def start_dump
+ super()
+ output.puts
+ end
+
+end
@@ -0,0 +1,23 @@
+# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
+
+Gem::Specification.new do |s|
+ s.name = "test-align-centaur"
+ s.version = '1.0.0'
+ s.platform = Gem::Platform::RUBY
+ s.authors = ["Tim Pope", "Robert Pitts"]
+ s.email = ["code@tpo"+"pe.net"]
+ s.homepage = "http://github.com/tpope/test-align-centaur"
+ s.summary = %q{The Centaur RSpec progress bar formatter}
+ s.description = %q{Centaur your RSpec progress output}
+
+ s.rubyforge_project = "test-align-centaur"
+
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ s.require_paths = ["lib"]
+
+ s.add_runtime_dependency 'centaur'
+ s.add_runtime_dependency 'rspec', '~> 2.0'
+end

0 comments on commit aaa34ba

Please sign in to comment.