mynyml-redgreen 0.5.2 → 0.6

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,18 +1,10 @@
1
- load 'test/tests.rake'
2
- task(:default => "test:all")
3
-
4
1
  # --------------------------------------------------
5
2
  # Tests
6
3
  # --------------------------------------------------
7
- namespace(:test) do
4
+ load 'test/tests.rake'
5
+ task(:default => "test:all")
8
6
 
9
- desc "Run all tests"
10
- task(:all) do
11
- tests = Dir['test/**/test_*.rb'] - ['test/test_helper.rb']
12
- cmd = "ruby -rubygems -I.:lib -e'%w( #{tests.join(' ')} ).each {|file| require file }'"
13
- puts(cmd) if ENV['VERBOSE']
14
- system(cmd)
15
- end
7
+ namespace(:test) do
16
8
 
17
9
  desc "Run all tests on multiple ruby versions (requires rvm)"
18
10
  task(:portability) do
@@ -1,19 +1,20 @@
1
1
  require 'expectations/suite_results'
2
- require 'override'
3
2
 
4
3
  class Expectations::SuiteResults
5
- override :print_success
6
- def print_success
7
- super
4
+ def new_print_success
5
+ old_print_success
8
6
  out.puts RedGreen.visual
9
7
  out.puts
10
8
  end
9
+ alias :old_print_success :print_success
10
+ alias :print_success :new_print_success
11
11
 
12
- override :print_fail
13
- def print_fail
14
- super
12
+ def new_print_fail
13
+ old_print_fail
15
14
  RedGreen.colour = :red
16
15
  out.puts RedGreen.visual
17
16
  out.puts
18
17
  end
18
+ alias :old_print_fail :print_fail
19
+ alias :print_fail :new_print_fail
19
20
  end
@@ -1,21 +1,22 @@
1
1
  require 'minitest/unit'
2
- require 'override'
3
2
 
4
3
  class MiniTest::Unit::TestCase
5
- override :run
6
- def run(runner)
7
- result = super
4
+ def new_run(runner)
5
+ result = old_run(runner)
8
6
  RedGreen.colour = :red unless self.passed?
9
7
  result
10
8
  end
9
+ alias :old_run :run
10
+ alias :run :new_run
11
11
  end
12
12
 
13
13
  class MiniTest::Unit
14
- override :run
15
- def run(args = [])
16
- count = super
14
+ def new_run(args = [])
15
+ count = old_run(args)
17
16
  @@out.puts RedGreen.visual
18
17
  @@out.puts
19
18
  count
20
19
  end
20
+ alias :old_run :run
21
+ alias :run :new_run
21
22
  end
@@ -1,20 +1,21 @@
1
1
  require 'test/unit/testresult'
2
2
  require 'test/unit/ui/console/testrunner'
3
3
  require 'test/unit/ui/testrunnermediator'
4
- require 'override'
5
4
 
6
5
  class Test::Unit::UI::Console::TestRunner
7
6
 
8
- override :attach_to_mediator
9
- def attach_to_mediator
10
- super
7
+ def new_attach_to_mediator
8
+ old_attach_to_mediator
11
9
  @mediator.add_listener(Test::Unit::TestResult::FAULT) { RedGreen.colour = :red }
12
10
  end
11
+ alias :old_attach_to_mediator :attach_to_mediator
12
+ alias :attach_to_mediator :new_attach_to_mediator
13
13
 
14
- override :finished
15
- def finished(elapsed_time)
16
- super
14
+ def new_finished(elapsed_time)
15
+ old_finished(elapsed_time)
17
16
  output(RedGreen.visual)
18
17
  nl
19
18
  end
19
+ alias :old_finished :finished
20
+ alias :finished :new_finished
20
21
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'mynyml-redgreen'
3
- s.version = '0.5.2'
3
+ s.version = '0.6'
4
4
  s.summary = "Standalone redgreen eye candy for test results, ala autotest"
5
5
  s.description = "Standalone redgreen eye candy for test results, ala autotest."
6
6
  s.author = "Martin Aumont"
@@ -11,13 +11,12 @@ Gem::Specification.new do |s|
11
11
  s.require_path = "lib"
12
12
  s.files = File.read("Manifest").strip.split("\n")
13
13
 
14
- s.add_dependency 'mynyml-override', '>= 0.5.2' #gemcutter
15
14
  s.add_dependency 'term-ansicolor', '>= 1.0.4'
16
15
 
17
16
  s.add_development_dependency 'minitest', '>= 1.3.1'
18
17
  s.add_development_dependency 'expectations', '>= 1.2.1'
19
- s.add_development_dependency 'thoughtbot-shoulda', '>= 2.10.1'
20
- s.add_development_dependency 'citrusbyte-contest', '>= 0.1.1'
18
+ s.add_development_dependency 'shoulda', '>= 2.10.1'
19
+ s.add_development_dependency 'contest', '>= 0.1.1'
21
20
  s.add_development_dependency 'jeremymcanally-context', '>= 0.5.5'
22
21
  end
23
22
 
@@ -2,26 +2,14 @@
2
2
  #
3
3
  # $ watchr specs.watchr
4
4
 
5
- # --------------------------------------------------
6
- # Helpers
7
- # --------------------------------------------------
8
- def run(cmd)
9
- puts(cmd)
10
- system(cmd)
11
- end
12
-
13
- def run_all_tests
14
- # see Rakefile for the definition of the test:all task
15
- system( "rake -s test:all VERBOSE=true" )
16
- end
17
-
18
5
  # --------------------------------------------------
19
6
  # Watchr Rules
20
7
  # --------------------------------------------------
21
- watch( '^examples\.rb' ) { |m| system( "ruby -rubygems -Ilib %s" % m[0] ) }
22
- watch( '^test.*/test_.*\.rb' ) { |m| run( "ruby -rubygems -Ilib %s" % m[0] ) }
23
- watch( '^lib/(.*)\.rb' ) { |m| run( "ruby -rubygems -Ilib test/test_%s.rb" % m[1] ) }
24
- watch( '^test/test_helper\.rb' ) { run_all_tests }
8
+ watch( '^test.*/test_.*\.rb' ) { |m| system "ruby -rubygems -I.:lib %s" % m[0] }
9
+ watch( '^lib/redgreen/(.*)\.rb' ) { |m| system "rake test:by_fw FW=%s" % m[1] }
10
+ watch( '^lib/redgreen/testunit\.rb' ) { |m| system "rake test:by_fw FW=testunit,shoulda,context,contest" }
11
+ watch( '^lib/redgreen\.rb' ) { |m| system "rake -s test:all" }
12
+ watch( '^test/test_helper\.rb' ) { |m| system "rake -s test:all" }
25
13
 
26
14
  # --------------------------------------------------
27
15
  # Signal Handling
@@ -29,7 +17,7 @@ watch( '^test/test_helper\.rb' ) { run_all_tests }
29
17
  # Ctrl-\
30
18
  Signal.trap('QUIT') do
31
19
  puts " --- Running all tests ---\n\n"
32
- run_all_tests
20
+ system "rake -s test:all"
33
21
  end
34
22
 
35
23
  # Ctrl-C
@@ -1,7 +1,5 @@
1
- require 'pathname'
2
1
  require 'contest'
3
- root = Pathname(__FILE__).dirname.parent.parent
4
- require root + 'lib/redgreen'
2
+ require 'lib/redgreen'
5
3
 
6
4
  class TestContestFailure < Test::Unit::TestCase
7
5
  def test_failure
@@ -1,7 +1,5 @@
1
- require 'pathname'
2
1
  require 'contest'
3
- root = Pathname(__FILE__).dirname.parent.parent
4
- require root + 'lib/redgreen'
2
+ require 'lib/redgreen'
5
3
 
6
4
  class TestContestSuccess < Test::Unit::TestCase
7
5
  def test_success
@@ -1,7 +1,5 @@
1
- require 'pathname'
2
1
  require 'context'
3
- root = Pathname(__FILE__).dirname.parent.parent
4
- require root + 'lib/redgreen'
2
+ require 'lib/redgreen'
5
3
 
6
4
  class TestContextFailure < Test::Unit::TestCase
7
5
  def test_failure
@@ -1,7 +1,5 @@
1
- require 'pathname'
2
1
  require 'context'
3
- root = Pathname(__FILE__).dirname.parent.parent
4
- require root + 'lib/redgreen'
2
+ require 'lib/redgreen'
5
3
 
6
4
  class TestContextSuccess < Test::Unit::TestCase
7
5
  def test_success
@@ -1,10 +1,12 @@
1
- require 'pathname'
1
+ unless RUBY_VERSION >= '1.9'
2
+
2
3
  require 'expectations'
3
- root = Pathname(__FILE__).dirname.parent.parent
4
- require root + 'lib/redgreen'
4
+ require 'lib/redgreen'
5
5
 
6
6
  Expectations do
7
7
  expect "THIS TEST SHOULD FAIL" do
8
8
  true
9
9
  end
10
10
  end
11
+
12
+ end
@@ -1,10 +1,12 @@
1
- require 'pathname'
1
+ unless RUBY_VERSION >= '1.9'
2
+
2
3
  require 'expectations'
3
- root = Pathname(__FILE__).dirname.parent.parent
4
- require root + 'lib/redgreen'
4
+ require 'lib/redgreen'
5
5
 
6
6
  Expectations do
7
7
  expect "THIS TEST SHOULD PASS" do
8
8
  "THIS TEST SHOULD PASS"
9
9
  end
10
10
  end
11
+
12
+ end
@@ -1,7 +1,5 @@
1
- require 'pathname'
2
1
  require 'minitest/autorun'
3
- root = Pathname(__FILE__).dirname.parent.parent
4
- require root + 'lib/redgreen'
2
+ require 'lib/redgreen'
5
3
 
6
4
  class TestTestUnitFailure < MiniTest::Unit::TestCase
7
5
  def test_failure
@@ -1,7 +1,5 @@
1
- require 'pathname'
2
1
  require 'minitest/autorun'
3
- root = Pathname(__FILE__).dirname.parent.parent
4
- require root + 'lib/redgreen'
2
+ require 'lib/redgreen'
5
3
 
6
4
  class TestTestUnitSuccess < MiniTest::Unit::TestCase
7
5
  def test_success
@@ -1,7 +1,5 @@
1
- require 'pathname'
2
1
  require 'shoulda'
3
- root = Pathname(__FILE__).dirname.parent.parent
4
- require root + 'lib/redgreen'
2
+ require 'lib/redgreen'
5
3
 
6
4
  class TestShouldaFailure < Test::Unit::TestCase
7
5
  def test_failure
@@ -1,7 +1,5 @@
1
- require 'pathname'
2
1
  require 'shoulda'
3
- root = Pathname(__FILE__).dirname.parent.parent
4
- require root + 'lib/redgreen'
2
+ require 'lib/redgreen'
5
3
 
6
4
  class TestShouldaSuccess < Test::Unit::TestCase
7
5
  def test_success
@@ -6,18 +6,18 @@ namespace(:test) do
6
6
  test_root = Pathname(__FILE__).dirname
7
7
 
8
8
  files = %w(
9
- testunit/test_success.rb
10
9
  testunit/test_failure.rb
11
- minitest/test_success.rb
10
+ testunit/test_success.rb
12
11
  minitest/test_failure.rb
13
- contest/test_success.rb
12
+ minitest/test_success.rb
14
13
  contest/test_failure.rb
15
- context/test_success.rb
14
+ contest/test_success.rb
16
15
  context/test_failure.rb
17
- shoulda/test_success.rb
16
+ context/test_success.rb
18
17
  shoulda/test_failure.rb
19
- expectations/test_success.rb
18
+ shoulda/test_success.rb
20
19
  expectations/test_failure.rb
20
+ expectations/test_success.rb
21
21
  )
22
22
  files.map! {|file| Pathname(file).expand_path(test_root) }
23
23
  files.each {|file| system("ruby -rubygems -I.:lib #{file}") }
@@ -1,7 +1,5 @@
1
- require 'pathname'
2
1
  require 'test/unit'
3
- root = Pathname(__FILE__).dirname.parent.parent
4
- require root + 'lib/redgreen'
2
+ require 'lib/redgreen'
5
3
 
6
4
  class TestTestUnitFailure < Test::Unit::TestCase
7
5
  def test_failure
@@ -1,7 +1,5 @@
1
- require 'pathname'
2
1
  require 'test/unit'
3
- root = Pathname(__FILE__).dirname.parent.parent
4
- require root + 'lib/redgreen'
2
+ require 'lib/redgreen'
5
3
 
6
4
  class TestTestUnitSuccess < Test::Unit::TestCase
7
5
  def test_success
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mynyml-redgreen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: "0.6"
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Aumont
@@ -12,16 +12,6 @@ cert_chain: []
12
12
  date: 2009-11-03 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: mynyml-override
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: 0.5.2
24
- version:
25
15
  - !ruby/object:Gem::Dependency
26
16
  name: term-ansicolor
27
17
  type: :runtime
@@ -53,7 +43,7 @@ dependencies:
53
43
  version: 1.2.1
54
44
  version:
55
45
  - !ruby/object:Gem::Dependency
56
- name: thoughtbot-shoulda
46
+ name: shoulda
57
47
  type: :development
58
48
  version_requirement:
59
49
  version_requirements: !ruby/object:Gem::Requirement
@@ -63,7 +53,7 @@ dependencies:
63
53
  version: 2.10.1
64
54
  version:
65
55
  - !ruby/object:Gem::Dependency
66
- name: citrusbyte-contest
56
+ name: contest
67
57
  type: :development
68
58
  version_requirement:
69
59
  version_requirements: !ruby/object:Gem::Requirement