minitest_visible 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZGY3MDJmZWQ1YmRmZDU4ZDcyZTk2NDE5YTNhOTYzZjQ1ZTgzZWM1Yw==
5
- data.tar.gz: !binary |-
6
- MmE2MTM2ZTI3MDI2NTlmZGI0NzlhYmFhMDE5NGZlZWRkMjUyOGYxMQ==
2
+ SHA1:
3
+ metadata.gz: 5c6e12ee17634c48d5e34e78ec50bf272615e7a6
4
+ data.tar.gz: 7a0987886872168b0f6a0493841d3f5551188e4d
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- YjdmMzMwNGJhN2Q3MTE5MWM3ODI4ZjMwNTUxM2Q0YWYyMDYzYTA4OTllNWU3
10
- ZjM2NmYxNDY1NWFiMDUxM2Q1YzQ2M2Q4OTliZDdkOTI4MmRhZjhlYjEwZWEz
11
- NDA5NjUyMGUxMTk2MjM3MWFmYTMxNjQwNzFkN2U5MjU0YWMyNWU=
12
- data.tar.gz: !binary |-
13
- MjhjNjJjNzViZWYzYTkxODNiMjJmZDg5OTczNWFhNGI5Mjk2ZGMwNGYyMmM4
14
- Y2ZiNjIwMGVmZTkwNjQzN2YxNmEyN2M4MDE3Y2U3NWNjMTgyMmM2ZWY2OTgz
15
- NTc2MTJhZGQxZDViOWIyY2Y0OTU1NzNjNjQ1MDgwODU3ZjlkMjI=
6
+ metadata.gz: 1fb67c02b3f850cd324cecef6239287f21b93aff5b3536f27052973c19f61fe7a1b2f8d898b227529d2e470a1523b7701610398de65d7242da8570c7b910e318
7
+ data.tar.gz: cad6bb5e7821204485b6cd267d89494164d6c2762d3d63865bca7cca64edbb2e55a703fe98a17f1f416cff781659e789335091b82844079435ec9c0e71dea5ba
data/README.md CHANGED
@@ -12,7 +12,7 @@ all the chaos of going fully verbose. A sample run follows:
12
12
 
13
13
  # Running tests:
14
14
 
15
- MiniTest version = 4.7.5, MinitestVisible version = 0.0.1
15
+ MiniTest version = 4.7.5
16
16
 
17
17
  Running test file: array_test.rb
18
18
  .
@@ -71,9 +71,12 @@ Simply add the line:
71
71
 
72
72
  Then, in the body of your test class add:
73
73
 
74
- MinitestVisible.track self, __FILE__
74
+ include MinitestVisible
75
75
 
76
76
  That is all that is needed. Test output will now be decorated as shown above.
77
+ While this is a bit more ceremony than is desirable, test files have a fair bit
78
+ of boilerplate stuff as it is. The template folder has the file xyzzy_test.rb
79
+ which is my template for creating test files. Copy, rename and use as you wish.
77
80
 
78
81
  ## Contributing
79
82
 
data/Rakefile CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env rake
2
2
  # coding: utf-8
3
3
 
4
+ require 'rake/testtask'
4
5
  require 'rdoc/task'
5
6
  require "bundler/gem_tasks"
6
7
 
@@ -17,10 +18,17 @@ RDoc::Task.new do |rdoc|
17
18
  #rdoc.options << '--coverage-report'
18
19
 
19
20
  #Set a title.
20
- rdoc.options << '--title' << 'fOOrth Language Internals'
21
+ rdoc.options << '--title' << 'Minitest Visible Internals'
21
22
 
22
23
  end
23
24
 
25
+ #Run the fOOrth unit test suite.
26
+ Rake::TestTask.new do |t|
27
+ #List out all the test files.
28
+ t.test_files = FileList['tests/**/*.rb']
29
+ t.verbose = false
30
+ end
31
+
24
32
  desc "Run a scan for smelly code!"
25
33
  task :reek do |t|
26
34
  `reek --no-color lib > reek.txt`
@@ -4,8 +4,11 @@ require "minitest_visible/version"
4
4
  #running of tests under the MiniTest gem.
5
5
  module MinitestVisible
6
6
 
7
- def self.track(target, file)
8
- action = lambda do |*all|
7
+ #Tracking via a module include.
8
+ def self.included(target)
9
+ file = (/^.+(?=:\d+:in)/.match(caller[0])).to_s
10
+
11
+ target.send(:define_method, :initialize) do |*all|
9
12
  unless defined? $minitest_visible_once_per_run
10
13
  $minitest_visible_once_per_run = :done
11
14
  puts "MiniTest version = #{MiniTest::Unit::VERSION}"
@@ -17,10 +20,26 @@ module MinitestVisible
17
20
  end
18
21
 
19
22
  super(*all)
23
+ end
24
+ end
25
+
26
+ #The older tracking mechanism. Deprecated.
27
+ def self.track(target, file)
28
+ target.send(:define_method, :initialize) do |*all|
29
+ unless defined? $minitest_visible_once_per_run
30
+ $minitest_visible_once_per_run = :done
31
+ puts "MiniTest version = #{MiniTest::Unit::VERSION}"
32
+ end
20
33
 
34
+ if $minitest_visible_once_per_file != file
35
+ puts "\nRunning test file: #{File.split(file)[1]}"
36
+ puts "The track method is deprecated. Use include MinitestVisible instead."
37
+ $minitest_visible_once_per_file = file
21
38
  end
22
39
 
23
- target.send(:define_method, :initialize, &action)
40
+ super(*all)
41
+ end
42
+
24
43
  end
25
44
 
26
45
  end
@@ -1,4 +1,4 @@
1
1
  module MinitestVisible
2
2
  #The version of this module.
3
- VERSION = "0.0.2"
3
+ VERSION = "0.1.0"
4
4
  end
@@ -0,0 +1,18 @@
1
+ # coding: utf-8
2
+
3
+ #require what ever is being tested here.
4
+
5
+ gem 'minitest'
6
+ require 'minitest/autorun'
7
+ require 'minitest_visible'
8
+
9
+ #Test the testing process.
10
+ class TheThingBeingTestedTester < Minitest::Test
11
+
12
+ #Track mini-test progress.
13
+ include MinitestVisible
14
+
15
+ #Actual tests methods go here
16
+
17
+ end
18
+
@@ -0,0 +1,50 @@
1
+ # coding: utf-8
2
+
3
+ gem 'minitest'
4
+ require 'minitest/autorun'
5
+ require 'minitest_visible'
6
+
7
+ #Test the testing process.
8
+ class PartOneTester < Minitest::Test
9
+
10
+ #Track mini-test progress.
11
+ include MinitestVisible
12
+
13
+ def test_for_one
14
+ assert_equal(1, 1.0)
15
+ end
16
+
17
+ def test_for_two
18
+ assert_equal(2, 2.0)
19
+ end
20
+
21
+ def test_for_three
22
+ assert_equal(3, 3.0)
23
+ end
24
+
25
+ def test_for_four
26
+ assert_equal(4, 4.0)
27
+ end
28
+
29
+ def test_for_five
30
+ assert_equal(5, 5.0)
31
+ end
32
+
33
+ def test_for_six
34
+ assert_equal(6, 6.0)
35
+ end
36
+
37
+ def test_for_seven
38
+ assert_equal(7, 7.0)
39
+ end
40
+
41
+ def test_for_eight
42
+ assert_equal(8, 8.0)
43
+ end
44
+
45
+ def test_for_nine
46
+ assert_equal(9, 9.0)
47
+ end
48
+
49
+ end
50
+
@@ -0,0 +1,50 @@
1
+ # coding: utf-8
2
+
3
+ gem 'minitest'
4
+ require 'minitest/autorun'
5
+ require 'minitest_visible'
6
+
7
+ #Test the testing process.
8
+ class PartThreeTester < Minitest::Test
9
+
10
+ #Track mini-test progress.
11
+ include MinitestVisible
12
+
13
+ def test_for_one
14
+ assert_equal(1, 1.0)
15
+ end
16
+
17
+ def test_for_two
18
+ assert_equal(2, 2.0)
19
+ end
20
+
21
+ def test_for_three
22
+ assert_equal(3, 3.0)
23
+ end
24
+
25
+ def test_for_four
26
+ assert_equal(4, 4.0)
27
+ end
28
+
29
+ def test_for_five
30
+ assert_equal(5, 5.0)
31
+ end
32
+
33
+ def test_for_six
34
+ assert_equal(6, 6.0)
35
+ end
36
+
37
+ def test_for_seven
38
+ assert_equal(7, 7.0)
39
+ end
40
+
41
+ def test_for_eight
42
+ assert_equal(8, 8.0)
43
+ end
44
+
45
+ def test_for_nine
46
+ assert_equal(9, 9.0)
47
+ end
48
+
49
+ end
50
+
@@ -0,0 +1,50 @@
1
+ # coding: utf-8
2
+
3
+ gem 'minitest'
4
+ require 'minitest/autorun'
5
+ require 'minitest_visible'
6
+
7
+ #Test the testing process.
8
+ class PartTwoTester < Minitest::Test
9
+
10
+ #Track mini-test progress.
11
+ include MinitestVisible
12
+
13
+ def test_for_one
14
+ assert_equal(1, 1.0)
15
+ end
16
+
17
+ def test_for_two
18
+ assert_equal(2, 2.0)
19
+ end
20
+
21
+ def test_for_three
22
+ assert_equal(3, 3.0)
23
+ end
24
+
25
+ def test_for_four
26
+ assert_equal(4, 4.0)
27
+ end
28
+
29
+ def test_for_five
30
+ assert_equal(5, 5.0)
31
+ end
32
+
33
+ def test_for_six
34
+ assert_equal(6, 6.0)
35
+ end
36
+
37
+ def test_for_seven
38
+ assert_equal(7, 7.0)
39
+ end
40
+
41
+ def test_for_eight
42
+ assert_equal(8, 8.0)
43
+ end
44
+
45
+ def test_for_nine
46
+ assert_equal(9, 9.0)
47
+ end
48
+
49
+ end
50
+
metadata CHANGED
@@ -1,83 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest_visible
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Camilleri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-04 00:00:00.000000000 Z
11
+ date: 2016-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: reek
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: 1.3.8
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 1.3.8
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rdoc
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: 4.0.1
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 4.0.1
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: minitest
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ! '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ! '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  description: Slightly more visible progress for mini-test.
@@ -87,7 +87,7 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
- - .gitignore
90
+ - ".gitignore"
91
91
  - Gemfile
92
92
  - LICENSE.txt
93
93
  - README.md
@@ -95,6 +95,10 @@ files:
95
95
  - lib/minitest_visible.rb
96
96
  - lib/minitest_visible/version.rb
97
97
  - minitest_visible.gemspec
98
+ - template/xyzzy_tests.rb
99
+ - tests/part_one_tests.rb
100
+ - tests/part_three_tests.rb
101
+ - tests/part_two_tests.rb
98
102
  homepage: http://teuthida-technologies.com/
99
103
  licenses:
100
104
  - MIT
@@ -105,17 +109,17 @@ require_paths:
105
109
  - lib
106
110
  required_ruby_version: !ruby/object:Gem::Requirement
107
111
  requirements:
108
- - - ! '>='
112
+ - - ">="
109
113
  - !ruby/object:Gem::Version
110
114
  version: 1.9.3
111
115
  required_rubygems_version: !ruby/object:Gem::Requirement
112
116
  requirements:
113
- - - ! '>='
117
+ - - ">="
114
118
  - !ruby/object:Gem::Version
115
119
  version: '0'
116
120
  requirements: []
117
121
  rubyforge_project:
118
- rubygems_version: 2.1.4
122
+ rubygems_version: 2.2.2
119
123
  signing_key:
120
124
  specification_version: 4
121
125
  summary: A bit of embellishment for mini-test progress.