mega-sharp-tool 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/mega-sharp-tool.gemspec +12 -0
- data/minitest-6.0.6/History.rdoc +1860 -0
- data/minitest-6.0.6/Manifest.txt +41 -0
- data/minitest-6.0.6/README.rdoc +763 -0
- data/minitest-6.0.6/Rakefile +89 -0
- data/minitest-6.0.6/bin/minitest +5 -0
- data/minitest-6.0.6/design_rationale.rb +54 -0
- data/minitest-6.0.6/lib/hoe/minitest.rb +30 -0
- data/minitest-6.0.6/lib/minitest/assertions.rb +821 -0
- data/minitest-6.0.6/lib/minitest/autorun.rb +5 -0
- data/minitest-6.0.6/lib/minitest/benchmark.rb +452 -0
- data/minitest-6.0.6/lib/minitest/bisect.rb +304 -0
- data/minitest-6.0.6/lib/minitest/complete.rb +56 -0
- data/minitest-6.0.6/lib/minitest/compress.rb +94 -0
- data/minitest-6.0.6/lib/minitest/error_on_warning.rb +11 -0
- data/minitest-6.0.6/lib/minitest/expectations.rb +321 -0
- data/minitest-6.0.6/lib/minitest/find_minimal_combination.rb +127 -0
- data/minitest-6.0.6/lib/minitest/hell.rb +11 -0
- data/minitest-6.0.6/lib/minitest/manual_plugins.rb +4 -0
- data/minitest-6.0.6/lib/minitest/parallel.rb +72 -0
- data/minitest-6.0.6/lib/minitest/path_expander.rb +432 -0
- data/minitest-6.0.6/lib/minitest/pride.rb +4 -0
- data/minitest-6.0.6/lib/minitest/pride_plugin.rb +135 -0
- data/minitest-6.0.6/lib/minitest/server.rb +49 -0
- data/minitest-6.0.6/lib/minitest/server_plugin.rb +88 -0
- data/minitest-6.0.6/lib/minitest/spec.rb +324 -0
- data/minitest-6.0.6/lib/minitest/sprint.rb +105 -0
- data/minitest-6.0.6/lib/minitest/sprint_plugin.rb +39 -0
- data/minitest-6.0.6/lib/minitest/test.rb +232 -0
- data/minitest-6.0.6/lib/minitest/test_task.rb +331 -0
- data/minitest-6.0.6/lib/minitest.rb +1232 -0
- data/minitest-6.0.6/test/minitest/metametameta.rb +150 -0
- data/minitest-6.0.6/test/minitest/test_bisect.rb +249 -0
- data/minitest-6.0.6/test/minitest/test_find_minimal_combination.rb +138 -0
- data/minitest-6.0.6/test/minitest/test_minitest_assertions.rb +1729 -0
- data/minitest-6.0.6/test/minitest/test_minitest_benchmark.rb +151 -0
- data/minitest-6.0.6/test/minitest/test_minitest_reporter.rb +437 -0
- data/minitest-6.0.6/test/minitest/test_minitest_spec.rb +1095 -0
- data/minitest-6.0.6/test/minitest/test_minitest_test.rb +1295 -0
- data/minitest-6.0.6/test/minitest/test_minitest_test_task.rb +57 -0
- data/minitest-6.0.6/test/minitest/test_path_expander.rb +229 -0
- data/minitest-6.0.6/test/minitest/test_server.rb +146 -0
- metadata +83 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# -*- ruby -*-
|
|
2
|
+
|
|
3
|
+
require "hoe"
|
|
4
|
+
$:.unshift "lib" # to pick up lib/minitest/test_task.rb when minitest not installed
|
|
5
|
+
|
|
6
|
+
Hoe.plugin :seattlerb
|
|
7
|
+
Hoe.plugin :isolate
|
|
8
|
+
Hoe.plugin :rdoc
|
|
9
|
+
Hoe.plugin :cov
|
|
10
|
+
|
|
11
|
+
Hoe.spec "minitest" do
|
|
12
|
+
developer "Ryan Davis", "ryand-ruby@zenspider.com"
|
|
13
|
+
|
|
14
|
+
license "MIT"
|
|
15
|
+
|
|
16
|
+
require_ruby_version ">= 3.2"
|
|
17
|
+
|
|
18
|
+
dependency "prism", "~> 1.5"
|
|
19
|
+
dependency "drb", "~> 2.0"
|
|
20
|
+
|
|
21
|
+
self.rdoc_locations << "l:/home/www/minite.st/html/docs"
|
|
22
|
+
|
|
23
|
+
self.cov_filter = %w[ tmp ]
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
desc "Find missing expectations"
|
|
27
|
+
task :specs do
|
|
28
|
+
$:.unshift "lib"
|
|
29
|
+
require "minitest/test"
|
|
30
|
+
require "minitest/spec"
|
|
31
|
+
|
|
32
|
+
pos_prefix, neg_prefix = "must", "wont"
|
|
33
|
+
skip_re = /^(must|wont)$|wont_(throw)|must_(block|not?_|nothing|send|raise$)/x
|
|
34
|
+
dont_flip_re = /(must|wont)_(include|respond_to)/
|
|
35
|
+
|
|
36
|
+
map = {
|
|
37
|
+
/(must_throw)s/ => '\1',
|
|
38
|
+
/(?!not)_same/ => "_be_same_as",
|
|
39
|
+
/_in_/ => "_be_within_",
|
|
40
|
+
/_operator/ => "_be",
|
|
41
|
+
/_includes/ => "_include",
|
|
42
|
+
/(must|wont)_(.*_of|nil|silent|empty)/ => '\1_be_\2',
|
|
43
|
+
/must_raises/ => "must_raise",
|
|
44
|
+
/(must|wont)_pattern/ => '\1_pattern_match',
|
|
45
|
+
/(must|wont)_predicate/ => '\1_be',
|
|
46
|
+
/(must|wont)_path_exists/ => 'path_\1_exist',
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
expectations = Minitest::Expectations.public_instance_methods.map(&:to_s)
|
|
50
|
+
assertions = Minitest::Assertions.public_instance_methods.map(&:to_s)
|
|
51
|
+
|
|
52
|
+
assertions.sort.each do |assertion|
|
|
53
|
+
expectation = case assertion
|
|
54
|
+
when /^assert/ then
|
|
55
|
+
assertion.sub(/^assert/, pos_prefix.to_s)
|
|
56
|
+
when /^refute/ then
|
|
57
|
+
assertion.sub(/^refute/, neg_prefix.to_s)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
next unless expectation
|
|
61
|
+
next if expectation =~ skip_re
|
|
62
|
+
|
|
63
|
+
regexp, replacement = map.find { |re, _| expectation =~ re }
|
|
64
|
+
expectation.sub! regexp, replacement if replacement
|
|
65
|
+
|
|
66
|
+
next if expectations.include? expectation
|
|
67
|
+
|
|
68
|
+
args = [assertion, expectation].map(&:to_sym).map(&:inspect)
|
|
69
|
+
args << :reverse if expectation =~ dont_flip_re
|
|
70
|
+
|
|
71
|
+
puts
|
|
72
|
+
puts "##"
|
|
73
|
+
puts "# :method: #{expectation}"
|
|
74
|
+
puts "# See Minitest::Assertions##{assertion}"
|
|
75
|
+
puts
|
|
76
|
+
puts "infect_an_assertion #{args.join ", "}"
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
task :bugs do
|
|
81
|
+
sh "for f in bug*.rb ; do echo $f; echo; #{Gem.ruby} -Ilib $f && rm $f ; done"
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
Minitest::TestTask.create :testW0 do |t|
|
|
85
|
+
t.warning = false
|
|
86
|
+
t.test_prelude = "$-w = nil"
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# vim: syntax=Ruby
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Specs: # Equivalent Unit Tests:
|
|
2
|
+
###############################################################################
|
|
3
|
+
describe Thingy do # class TestThingy < Minitest::Test
|
|
4
|
+
before do # def setup
|
|
5
|
+
# super
|
|
6
|
+
do_some_setup # do_some_setup
|
|
7
|
+
end # end
|
|
8
|
+
#
|
|
9
|
+
it "should do the first thing" do # def test_first_thing
|
|
10
|
+
_(1).must_equal 1 # assert_equal 1, 1
|
|
11
|
+
end # end
|
|
12
|
+
# end
|
|
13
|
+
#
|
|
14
|
+
describe SubThingy do # class TestSubThingy < TestThingy
|
|
15
|
+
before do # def setup
|
|
16
|
+
# super
|
|
17
|
+
do_more_setup # do_more_setup
|
|
18
|
+
end # end
|
|
19
|
+
#
|
|
20
|
+
it "should do the second thing" do # def test_second_thing
|
|
21
|
+
_(2).must_equal 2 # assert_equal 2, 2
|
|
22
|
+
end # end
|
|
23
|
+
end # end
|
|
24
|
+
end #
|
|
25
|
+
#
|
|
26
|
+
###############################################################################
|
|
27
|
+
# runs 2 specs # runs 3 tests
|
|
28
|
+
###############################################################################
|
|
29
|
+
# The specs generate:
|
|
30
|
+
|
|
31
|
+
class ThingySpec < Minitest::Spec
|
|
32
|
+
def setup
|
|
33
|
+
super
|
|
34
|
+
do_some_setup
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def test_should_do_the_first_thing
|
|
38
|
+
_(1).must_equal 1
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
class SubThingySpec < ThingySpec
|
|
43
|
+
def setup
|
|
44
|
+
super
|
|
45
|
+
do_more_setup
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# because only setup/teardown is inherited, not specs
|
|
49
|
+
remove_method :test_should_do_the_first_thing
|
|
50
|
+
|
|
51
|
+
def test_should_do_the_second_thing
|
|
52
|
+
_(2).must_equal 2
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# :stopdoc:
|
|
2
|
+
|
|
3
|
+
class Hoe
|
|
4
|
+
# empty
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
module Hoe::Minitest
|
|
8
|
+
def minitest?
|
|
9
|
+
self.name == "minitest"
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def initialize_minitest
|
|
13
|
+
unless minitest? then
|
|
14
|
+
dir = File.expand_path "../..", __FILE__
|
|
15
|
+
|
|
16
|
+
Hoe.add_include_dirs dir if File.directory? dir
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
gem "minitest"
|
|
20
|
+
require "minitest"
|
|
21
|
+
version = Minitest::VERSION.split(".").first(2).join "."
|
|
22
|
+
|
|
23
|
+
dependency "minitest", "~> #{version}", :development unless
|
|
24
|
+
minitest? or ENV["MT_NO_ISOLATE"]
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def define_minitest_tasks
|
|
28
|
+
self.testlib = :minitest
|
|
29
|
+
end
|
|
30
|
+
end
|