test-rig 0.0.2 → 0.0.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.0.2
1
+ 0.0.3
@@ -13,7 +13,14 @@ module TestRig
13
13
  end
14
14
 
15
15
  def method_missing_with_dynamic_assertions(method, *args)
16
- if method.to_s =~ /^assert_(not_)?([a-z_]+)/
16
+ case method.to_s
17
+ when /^assert_no_([a-z_]+)$/
18
+ method_name = $1.to_sym
19
+ if args.first.respond_to? method_name
20
+ assert_nil args.first.send(method_name)
21
+ return
22
+ end
23
+ when /^assert_(not_)?([a-z_]+)$/
17
24
  method_name = $2.to_sym
18
25
  if args.length == 1 && args.first.respond_to?(:"#{method_name}?")
19
26
  actual = args.first.send :"#{method_name}?"
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{test-rig}
8
- s.version = "0.0.2"
8
+ s.version = "0.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jacob Rothstein"]
12
- s.date = %q{2009-12-02}
12
+ s.date = %q{2010-01-14}
13
13
  s.description = %q{TestRig supplies dynamic assertions and contextual failure messages}
14
14
  s.email = %q{github@jacobrothstein.com}
15
15
  s.extra_rdoc_files = [
@@ -4,6 +4,8 @@ class Entry
4
4
  def published?() false end
5
5
  def saved?() true end
6
6
  def user() "joe" end
7
+ def something_nil() nil end
8
+ def something_not_nil() "not nil" end
7
9
  end
8
10
 
9
11
  class DynamicAssertionsTest < Test::Unit::TestCase
@@ -52,4 +54,12 @@ class DynamicAssertionsTest < Test::Unit::TestCase
52
54
  test 'negative equality assertion failure' do
53
55
  assert_test_failure { assert_not_user 'joe', @entry }
54
56
  end
57
+
58
+ test "assert no" do
59
+ assert_no_something_nil @entry
60
+ end
61
+
62
+ test "assert no failure" do
63
+ assert_test_failure { assert_no_something_not_nil @entry }
64
+ end
55
65
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test-rig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jacob Rothstein
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-02 00:00:00 -08:00
12
+ date: 2010-01-14 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15