Skip to content

Commit

Permalink
Autodetects rails and changes test_pattern accordingly.
Browse files Browse the repository at this point in the history
Escapes slashes in random regexps.

[git-p4: depot-paths = "//src/heckle/dev/": change = 3010]
  • Loading branch information
zenspider committed Feb 13, 2007
1 parent d0f2b0d commit 1205b56
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
8 changes: 5 additions & 3 deletions History.txt
@@ -1,13 +1,15 @@
== 1.3.0 / 2007-02-07
== 1.3.0 / 2007-02-12

* 1 major enhancement:
* Unified diffs for mutatated methods
* 1 minor enhancement:
* 4 minor enhancements:
* Now returns exit status 1 if failed.
* Added a simple report at the end.
* Runs are now sorted by method.
* 1 bug fix:
* Autodetects rails and changes test_pattern accordingly.
* 2 bug fixes:
* Aborts when an unknown method is supplied.
* Escapes slashes in random regexps.

== 1.2.0 / 2007-01-15

Expand Down
3 changes: 3 additions & 0 deletions bin/heckle
Expand Up @@ -41,6 +41,9 @@ opts = OptionParser.new do |opts|
end
end

looks_like_rails = test ?f, 'config/environment.rb'
TestUnitHeckler.test_pattern = "test/**/*.rb" if looks_like_rails

opts.parse!

impl = ARGV.shift
Expand Down
2 changes: 1 addition & 1 deletion lib/heckle.rb
Expand Up @@ -177,7 +177,7 @@ def mutate_lit(exp)
when Symbol
[:lit, rand_symbol]
when Regexp
[:lit, Regexp.new(Regexp.escape(rand_string))]
[:lit, Regexp.new(Regexp.escape(rand_string.gsub(/\//, '\\/')))]
when Range
[:lit, rand_range]
end
Expand Down

0 comments on commit 1205b56

Please sign in to comment.