chaser 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.txt +4 -7
- data/Rakefile +3 -2
- data/bin/chaser +1 -1
- data/chaser.gemspec +52 -0
- data/lib/chaser.rb +1 -1
- data/lib/test_unit_chaser.rb +2 -1
- data/test/test_chaser.rb +9 -0
- metadata +4 -3
data/README.txt
CHANGED
@@ -1,7 +1,3 @@
|
|
1
|
-
= chaser
|
2
|
-
|
3
|
-
* Web site coming real soon now
|
4
|
-
|
5
1
|
== DESCRIPTION:
|
6
2
|
|
7
3
|
Chaser is unit test sadism(tm), like Seattlerb's Heckle. It's more or less mutation testing, except that rather than mutating every line of code it can get its claws into, it merely modifies the return value of targeted methods. If the unit tests don't notice the modified return values, or the program going haywire as a result of using those modified return values, then they aren't doing their jobs properly.
|
@@ -11,15 +7,16 @@ Unit test sadism is a trademark of Ryan Davis and Kevin Clark, and is used witho
|
|
11
7
|
== FEATURES/PROBLEMS:
|
12
8
|
|
13
9
|
* It only mutates the return values of methods.
|
14
|
-
* It
|
10
|
+
* It works in ruby 1.9, Windows, and JRuby.
|
15
11
|
|
16
12
|
== REQUIREMENTS:
|
17
13
|
|
18
|
-
*
|
14
|
+
* Test/Unit. Ruby 1.9 needs the test-unit gem, while ruby 1.8 doesn't require anything!
|
19
15
|
|
20
16
|
== INSTALL:
|
21
17
|
|
22
|
-
*
|
18
|
+
* Add gemcutter as a gem source.
|
19
|
+
* sudo gem install chaser
|
23
20
|
|
24
21
|
== LICENSE:
|
25
22
|
|
data/Rakefile
CHANGED
@@ -9,11 +9,12 @@ begin
|
|
9
9
|
gemspec.description = "Lightweight mutation testing in any flavor of ruby"
|
10
10
|
gemspec.email = "andrew.j.grimm@gmail.com"
|
11
11
|
gemspec.authors = ["Andrew Grimm", "Ryan Davis", "Eric Hodel", "Kevin Clark"]
|
12
|
-
gemspec.add_dependency('test-unit') #
|
12
|
+
#gemspec.add_dependency('test-unit') #FIXME Don't know how to only add the dependency for ruby 1.9
|
13
13
|
gemspec.version = Chaser::VERSION
|
14
|
+
gemspec.homepage = "http://andrewjgrimm.wordpress.com/2009/11/08/declare-war-on-everything-with-chaser/"
|
14
15
|
end
|
15
16
|
rescue LoadError
|
16
|
-
puts "Jeweler not available. Install it with: sudo gem install
|
17
|
+
puts "Jeweler not available. Install it with: sudo gem install jeweler"
|
17
18
|
end
|
18
19
|
|
19
20
|
task :test do
|
data/bin/chaser
CHANGED
@@ -18,7 +18,7 @@ opts = OptionParser.new do |opts|
|
|
18
18
|
end
|
19
19
|
|
20
20
|
opts.on("-t", "--tests TEST_PATTERN",
|
21
|
-
"Location of tests (glob)") do |pattern|
|
21
|
+
"Location of tests (glob). Unix-style even on Windows, so use forward slashes.") do |pattern|
|
22
22
|
TestUnitChaser.test_pattern = pattern
|
23
23
|
end
|
24
24
|
|
data/chaser.gemspec
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{chaser}
|
8
|
+
s.version = "0.0.2"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Andrew Grimm", "Ryan Davis", "Eric Hodel", "Kevin Clark"]
|
12
|
+
s.date = %q{2009-11-14}
|
13
|
+
s.default_executable = %q{chaser}
|
14
|
+
s.description = %q{Lightweight mutation testing in any flavor of ruby}
|
15
|
+
s.email = %q{andrew.j.grimm@gmail.com}
|
16
|
+
s.executables = ["chaser"]
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"README.txt"
|
19
|
+
]
|
20
|
+
s.files = [
|
21
|
+
"History.txt",
|
22
|
+
"Manifest.txt",
|
23
|
+
"README.txt",
|
24
|
+
"Rakefile",
|
25
|
+
"bin/chaser",
|
26
|
+
"chaser.gemspec",
|
27
|
+
"lib/chaser.rb",
|
28
|
+
"lib/test_unit_chaser.rb",
|
29
|
+
"test/fixtures/chased.rb",
|
30
|
+
"test/test_chaser.rb"
|
31
|
+
]
|
32
|
+
s.homepage = %q{http://andrewjgrimm.wordpress.com/2009/11/08/declare-war-on-everything-with-chaser/}
|
33
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
34
|
+
s.require_paths = ["lib"]
|
35
|
+
s.rubygems_version = %q{1.3.5}
|
36
|
+
s.summary = %q{Unit test sadism, with less masochism}
|
37
|
+
s.test_files = [
|
38
|
+
"test/fixtures/chased.rb",
|
39
|
+
"test/test_chaser.rb"
|
40
|
+
]
|
41
|
+
|
42
|
+
if s.respond_to? :specification_version then
|
43
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
44
|
+
s.specification_version = 3
|
45
|
+
|
46
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
47
|
+
else
|
48
|
+
end
|
49
|
+
else
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
data/lib/chaser.rb
CHANGED
data/lib/test_unit_chaser.rb
CHANGED
@@ -24,6 +24,7 @@ class TestUnitChaser < Chaser
|
|
24
24
|
|
25
25
|
def self.load_test_files
|
26
26
|
@@tests_loaded = true
|
27
|
+
raise "Can't detect any files in test pattern \"#{@@test_pattern}\"#{WINDOZE ? " Are you remembering to use forward slashes?" : ""}" if Dir.glob(@@test_pattern).empty?
|
27
28
|
Dir.glob(@@test_pattern).each {|test| require test}
|
28
29
|
end
|
29
30
|
|
@@ -37,7 +38,7 @@ class TestUnitChaser < Chaser
|
|
37
38
|
if method_name =~ /self\./
|
38
39
|
abort "Unknown method: #{klass_name}.#{method_name.gsub('self.', '')}" unless klass_methods.include? method_name
|
39
40
|
else
|
40
|
-
abort "Unknown method: #{klass_name}##{method_name}" unless klass.instance_methods(false).include? method_name
|
41
|
+
abort "Unknown method: #{klass_name}##{method_name}" unless klass.instance_methods(false).map{|sym| sym.to_s}.include? method_name
|
41
42
|
end
|
42
43
|
end
|
43
44
|
|
data/test/test_chaser.rb
CHANGED
@@ -74,3 +74,12 @@ class ChaserTestCase < Test::Unit::TestCase
|
|
74
74
|
end
|
75
75
|
|
76
76
|
|
77
|
+
class TestUnitChaserCase < Test::Unit::TestCase
|
78
|
+
def test_detects_invalid_glob
|
79
|
+
incorrect_glob = "test\test_chaser.rb"
|
80
|
+
TestUnitChaser.test_pattern = incorrect_glob
|
81
|
+
assert_raise(RuntimeError, "Can't detect an incorrect glob") do
|
82
|
+
TestUnitChaser.load_test_files
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chaser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Grimm
|
@@ -12,7 +12,7 @@ autorequire:
|
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
14
|
|
15
|
-
date: 2009-11-
|
15
|
+
date: 2009-11-14 00:00:00 +11:00
|
16
16
|
default_executable: chaser
|
17
17
|
dependencies: []
|
18
18
|
|
@@ -30,12 +30,13 @@ files:
|
|
30
30
|
- README.txt
|
31
31
|
- Rakefile
|
32
32
|
- bin/chaser
|
33
|
+
- chaser.gemspec
|
33
34
|
- lib/chaser.rb
|
34
35
|
- lib/test_unit_chaser.rb
|
35
36
|
- test/fixtures/chased.rb
|
36
37
|
- test/test_chaser.rb
|
37
38
|
has_rdoc: true
|
38
|
-
homepage:
|
39
|
+
homepage: http://andrewjgrimm.wordpress.com/2009/11/08/declare-war-on-everything-with-chaser/
|
39
40
|
licenses: []
|
40
41
|
|
41
42
|
post_install_message:
|