autowatchr 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
data/autowatchr.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{autowatchr}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jeremy Stephens"]
12
- s.date = %q{2009-10-06}
12
+ s.date = %q{2009-10-14}
13
13
  s.description = %q{Provides some autotest-like behavior for watchr (http://github.com/mynyml/watchr).}
14
14
  s.email = %q{viking415@gmail.com}
15
15
  s.extra_rdoc_files = [
data/lib/autowatchr.rb CHANGED
@@ -175,7 +175,7 @@ class Autowatchr
175
175
  key = classname_to_path(class_name)
176
176
  if files_ran.include?(key)
177
177
  @failed_tests[key] ||= []
178
- @failed_tests[key] << test_name
178
+ @failed_tests[key] |= [test_name]
179
179
  previously_failed.delete(key)
180
180
  else
181
181
  puts "Couldn't map class to file: #{class_name}"
@@ -121,6 +121,7 @@ class TestAutowatchr < Test::Unit::TestCase
121
121
  aw = new_autowatchr
122
122
  end
123
123
  assert_equal "#{@test_dir}/test_foo.rb", aw.classname_to_path("TestFoo")
124
+ assert_equal "#{@test_dir}/test_foo/test_baz.rb", aw.classname_to_path("TestFoo::TestBaz")
124
125
  end
125
126
 
126
127
  def test_only_runs_failing_tests
@@ -138,6 +139,26 @@ class TestAutowatchr < Test::Unit::TestCase
138
139
  end
139
140
  end
140
141
 
142
+ def test_only_registers_failing_test_once
143
+ Autowatchr.any_instance.stubs_system_call("all")
144
+ aw = nil
145
+ silence_stream(STDOUT) do
146
+ aw = new_autowatchr
147
+ end
148
+
149
+ expected_cmd = %!/usr/local/bin/ruby -I.:#{@lib_dir}:#{@test_dir} #{@test_dir}/test_foo.rb -n "/^(test_flunk)$/"!
150
+ aw.expects_system_call(expected_cmd, "foo_flunk")
151
+ silence_stream(STDOUT) do
152
+ aw.run_test_file("#{@test_dir}/test_foo.rb")
153
+ end
154
+
155
+ expected_cmd = %!/usr/local/bin/ruby -I.:#{@lib_dir}:#{@test_dir} #{@test_dir}/test_foo.rb -n "/^(test_flunk)$/"!
156
+ aw.expects_system_call(expected_cmd, "foo_flunk")
157
+ silence_stream(STDOUT) do
158
+ aw.run_test_file("#{@test_dir}/test_foo.rb")
159
+ end
160
+ end
161
+
141
162
  def test_clears_failing_test_when_it_passes
142
163
  Autowatchr.any_instance.stubs_system_call("all")
143
164
  aw = nil
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autowatchr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Stephens
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-06 00:00:00 -05:00
12
+ date: 2009-10-14 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency