test-rig 0.0.2 → 0.0.3
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 +1 -1
- data/lib/test_rig/dynamic_assertions.rb +8 -1
- data/test-rig.gemspec +2 -2
- data/test/dynamic_assertions_test.rb +10 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
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
|
-
|
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}?"
|
data/test-rig.gemspec
CHANGED
@@ -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.
|
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{
|
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.
|
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:
|
12
|
+
date: 2010-01-14 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|