testdependencies 0.4.0 → 0.5.0

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.5.0
@@ -2,8 +2,10 @@ ActiveSupport::TestCase.module_eval do
2
2
  class<<self
3
3
  alias old_test test
4
4
  def test(decl, &block)
5
- unless String === decl
6
- old_test decl.keys.first do
5
+ name = decl
6
+ if Hash === decl
7
+ name = decl.keys.first
8
+ old_test name do
7
9
  dep = decl.values.first
8
10
  dep = "test_#{dep.gsub(/\s+/,'_')}".to_sym if String === dep
9
11
  raise "Dependency undefined: #{dep}" unless respond_to?(dep)
@@ -11,8 +13,9 @@ ActiveSupport::TestCase.module_eval do
11
13
  instance_exec(*result, &block) unless result == :__failure_in_dep
12
14
  end
13
15
  else
14
- old_test decl, &block
16
+ old_test name, &block
15
17
  end
18
+ name
16
19
  end
17
20
  end
18
21
  end
@@ -2,7 +2,8 @@ ActiveSupport::TestCase.module_eval do
2
2
  class<<self
3
3
  alias old_should should
4
4
  def should(decl, &block)
5
- unless String === decl
5
+ name = decl
6
+ if Hash === decl
6
7
  old_should decl.keys.first do
7
8
  dep = decl.values.first
8
9
  dep = "test: #{self.class.to_s.gsub('Test', '')} should #{dep}. ".to_sym if String === dep
@@ -13,6 +14,7 @@ ActiveSupport::TestCase.module_eval do
13
14
  else
14
15
  old_should decl, &block
15
16
  end
17
+ name
16
18
  end
17
19
  end
18
- end
20
+ end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{testdependencies}
8
- s.version = "0.4.0"
8
+ s.version = "0.5.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Matthias Hennemeyer"]
12
- s.date = %q{2010-04-20}
12
+ s.date = %q{2010-04-27}
13
13
  s.description = %q{Add explicit dependencies to your Rails tests.}
14
14
  s.email = %q{mhennemeyer@me.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 4
7
+ - 5
8
8
  - 0
9
- version: 0.4.0
9
+ version: 0.5.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Matthias Hennemeyer
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-20 00:00:00 +02:00
17
+ date: 2010-04-27 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency