test-align-centaur 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in test-align-centaur.gemspec
4
+ gemspec
@@ -0,0 +1,16 @@
1
+ test-align: centaur;
2
+ ====================
3
+
4
+ ![Screenshot](https://github.com/tpope/test-align-centaur/raw/master/images/screenshot.png)
5
+
6
+ Tired of a boring old line of dots when running your RSpec suite? Fear no
7
+ more, as [`text-align: centaur;`](http://textaligncentaur.com) has been ported
8
+ to RSpec in the form of `test-align: centaur;`.
9
+
10
+ Usage
11
+ -----
12
+
13
+ $ gem install test-align-centaur
14
+ $ rspec -f TestAlignCentaur
15
+
16
+ $ echo '--format TestAlignCentaur' >> ~/.rspec
@@ -0,0 +1,10 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+ require "rspec/core/rake_task"
4
+
5
+ RSpec::Core::RakeTask.new(:spec) do |spec|
6
+ spec.rspec_opts = "--format TestAlignCentaur --color"
7
+ spec.pattern = "spec/**/*_spec.rb"
8
+ end
9
+
10
+ task :default => :spec
Binary file
@@ -0,0 +1 @@
1
+ require 'test_align_centaur'
@@ -0,0 +1,39 @@
1
+ require 'centaur'
2
+ require 'rspec/core/formatters/base_text_formatter'
3
+
4
+ class TestAlignCentaur < RSpec::Core::Formatters::BaseTextFormatter
5
+
6
+ def print(arg)
7
+ if @centaur.nil?
8
+ @centaur = String::CENTAUR.chomp
9
+ elsif @centaur.empty?
10
+ @centaur = "\n" + String::CENTAUR.chomp
11
+ end
12
+ while char = @centaur.slice!(0)
13
+ break if char == 'x'
14
+ output.print(char)
15
+ end
16
+ output.print(arg)
17
+ end
18
+
19
+ def example_passed(example)
20
+ super(example)
21
+ print green('.')
22
+ end
23
+
24
+ def example_pending(example)
25
+ super(example)
26
+ print yellow('*')
27
+ end
28
+
29
+ def example_failed(example)
30
+ super(example)
31
+ print red('F')
32
+ end
33
+
34
+ def start_dump
35
+ super()
36
+ output.puts
37
+ end
38
+
39
+ end
@@ -0,0 +1,27 @@
1
+ describe TestAlignCentaur do
2
+
3
+ def stall
4
+ sleep rand/16
5
+ end
6
+
7
+ def self.pass
8
+ it { stall }
9
+ end
10
+
11
+ def self.fail
12
+ it { stall; true.should be_false }
13
+ end
14
+
15
+ def self.pend(reason)
16
+ it { stall; pending(reason) }
17
+ end
18
+
19
+ 49.times { pass }
20
+
21
+ pend "Left eye"
22
+ pass
23
+ pend "Right eye"
24
+
25
+ 566.times { pass }
26
+
27
+ end
@@ -0,0 +1,23 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "test-align-centaur"
6
+ s.version = '1.0.0'
7
+ s.platform = Gem::Platform::RUBY
8
+ s.authors = ["Tim Pope", "Robert Pitts"]
9
+ s.email = ["code@tpo"+"pe.net"]
10
+ s.homepage = "http://github.com/tpope/test-align-centaur"
11
+ s.summary = %q{The Centaur RSpec progress bar formatter}
12
+ s.description = %q{Centaur your RSpec progress output}
13
+
14
+ s.rubyforge_project = "test-align-centaur"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ s.add_runtime_dependency 'centaur'
22
+ s.add_runtime_dependency 'rspec', '~> 2.0'
23
+ end
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: test-align-centaur
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 1.0.0
6
+ platform: ruby
7
+ authors:
8
+ - Tim Pope
9
+ - Robert Pitts
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+
14
+ date: 2011-03-31 00:00:00 -04:00
15
+ default_executable:
16
+ dependencies:
17
+ - !ruby/object:Gem::Dependency
18
+ name: centaur
19
+ prerelease: false
20
+ requirement: &id001 !ruby/object:Gem::Requirement
21
+ none: false
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: "0"
26
+ type: :runtime
27
+ version_requirements: *id001
28
+ - !ruby/object:Gem::Dependency
29
+ name: rspec
30
+ prerelease: false
31
+ requirement: &id002 !ruby/object:Gem::Requirement
32
+ none: false
33
+ requirements:
34
+ - - ~>
35
+ - !ruby/object:Gem::Version
36
+ version: "2.0"
37
+ type: :runtime
38
+ version_requirements: *id002
39
+ description: Centaur your RSpec progress output
40
+ email:
41
+ - code@tpope.net
42
+ executables: []
43
+
44
+ extensions: []
45
+
46
+ extra_rdoc_files: []
47
+
48
+ files:
49
+ - .gitignore
50
+ - Gemfile
51
+ - README.markdown
52
+ - Rakefile
53
+ - images/screenshot.png
54
+ - lib/test-align-centaur.rb
55
+ - lib/test_align_centaur.rb
56
+ - spec/centaur_spec.rb
57
+ - test-align-centaur.gemspec
58
+ has_rdoc: true
59
+ homepage: http://github.com/tpope/test-align-centaur
60
+ licenses: []
61
+
62
+ post_install_message:
63
+ rdoc_options: []
64
+
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ none: false
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: "0"
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: "0"
79
+ requirements: []
80
+
81
+ rubyforge_project: test-align-centaur
82
+ rubygems_version: 1.6.1
83
+ signing_key:
84
+ specification_version: 3
85
+ summary: The Centaur RSpec progress bar formatter
86
+ test_files:
87
+ - spec/centaur_spec.rb