test-rig 0.0.0 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,6 +6,18 @@ Test Rig provides two separate modules that work together.
6
6
  of the test failure.
7
7
  This library works well with something like "Context":http://github.com/jeremymcanally/context or Shoulda.
8
8
 
9
+ h2. Installation
10
+
11
+ If necessary, install "Gemcutter":http://gemcutter.org.
12
+ <pre><code>sudo gem install gemcutter && sudo gem tumble</code></pre>
13
+
14
+ Install test-rig
15
+ <pre><code>sudo gem install test-rig</code></pre>
16
+
17
+ Add @require 'testrig'@ to test_helper.rb, and @include TestRig@ into @Test::Unit:TestCase@.
18
+ If you only want dynamic assertions or smarter messages, @include TestRig::DynamicAssertions@
19
+ or @include TestRig::SmarterMessage@ instead of @TestRig@.
20
+
9
21
  h2. Dynamic assertions
10
22
 
11
23
  h3. Background & Philosophy
@@ -99,11 +111,11 @@ test demonstration(DemoTest) [./test/demo_test.rb:11]:
99
111
  <"foo"> expected but was
100
112
  <"bar">.
101
113
  ./test/smarter_message_test.rb:11:in `test demonstration'
102
- 9: a = 'foo'
103
- 10: b = 'bar'
104
- --> 11: assert_equal a, b
105
- 12: end
106
- 13:
114
+ 9: a = 'foo'
115
+ 10: b = 'bar'
116
+ --> 11: assert_equal a, b
117
+ 12: end
118
+ 13:end
107
119
  </code></pre>
108
120
 
109
121
  h3. Settings
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.0
1
+ 0.0.1
@@ -8,6 +8,10 @@ module TestRig
8
8
  end
9
9
  end
10
10
 
11
+ def assert_not(*args)
12
+ assert !args.shift, *args
13
+ end
14
+
11
15
  def method_missing_with_dynamic_assertions(method, *args)
12
16
  if method.to_s =~ /^assert_(not_)?([a-z_]+)/
13
17
  method_name = $2.to_sym
@@ -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.0"
8
+ s.version = "0.0.1"
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-10-22}
12
+ s.date = %q{2009-11-30}
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 = [
@@ -13,6 +13,14 @@ class DynamicAssertionsTest < Test::Unit::TestCase
13
13
  @entry = Entry.new
14
14
  end
15
15
 
16
+ test 'assert not' do
17
+ assert_not @entry.published?
18
+ end
19
+
20
+ test 'assert not failure' do
21
+ assert_test_failure { assert_not @entry.saved? }
22
+ end
23
+
16
24
  test "positive assertion" do
17
25
  assert_saved @entry
18
26
  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.0
4
+ version: 0.0.1
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-10-22 00:00:00 -07:00
12
+ date: 2009-11-30 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15