brass 1.1.0 → 1.2.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.
Files changed (6) hide show
  1. data/.ruby +1 -1
  2. data/.yardopts +7 -0
  3. data/HISTORY.rdoc +10 -0
  4. data/README.md +26 -25
  5. data/lib/brass.rb +1 -1
  6. metadata +8 -7
data/.ruby CHANGED
@@ -41,7 +41,7 @@ revision: 0
41
41
  created: '2012-01-24'
42
42
  summary: Bare-Metal Ruby Assertion System Standard
43
43
  title: BRASS
44
- version: 1.1.0
44
+ version: 1.2.0
45
45
  name: brass
46
46
  description: ! 'BRASS stands for Bare-Metal Ruby Assertion System Standard. It is
47
47
  a very basic
@@ -0,0 +1,7 @@
1
+ --title "BRASS"
2
+ --readme README.md
3
+ --protected
4
+ --private
5
+ lib
6
+ -
7
+ [A-Z]*.*
@@ -1,5 +1,15 @@
1
1
  = HISTORY
2
2
 
3
+ == 1.2.0 | 2012-01-26
4
+
5
+ The default error is `RuntimeError` rather than `StandardError` to
6
+ match Ruby's default exception when no arguments are passed to `raise`.
7
+
8
+ Changes:
9
+
10
+ * Change default error to RuntimeError.
11
+
12
+
3
13
  == 1.1.0 | 2012-01-25
4
14
 
5
15
  Quick fix for issue with parsing arguments of #assert and #refute methods.
data/README.md CHANGED
@@ -14,17 +14,17 @@ a framework's framework's framework, depending on where you're staking
14
14
  out your assertions keister.
15
15
 
16
16
  In other words, BRASS provides a standard rudimentary assertions framework
17
- that all other assertion and/or test framework can use, or at least comply
18
- with, and then everyone gets on swell.
17
+ that all other assertion and test frameworks can use, or at least comply
18
+ with, and then everyone gets on swimingly.
19
19
 
20
20
  Now, you may be thinking, "No thanks, I do it my way." But when you see
21
21
  how stupid simple BRASS is, you'll realize that, "Yea, that actually
22
- make sense." And feel a bit like a ass yourself for jumping to
23
- quick judgment.
22
+ make sense." And then maybe feel a bit stupid yourself for doing exactly
23
+ what this paragrah just said you would do. Yea, well, we've all been there.
24
24
 
25
- Now, enough fluffery.
25
+ But enough with the fluff.
26
26
 
27
- BRASS defines two Kernel methods: `assert` and `refute`
27
+ BRASS defines two Kernel methods: `assert` and `refute`:
28
28
 
29
29
  assert(truthiness, *fail_arguments)
30
30
  refute(truthiness, *fail_arguments)
@@ -33,38 +33,39 @@ Where `truthiness` is any object evaluated for it's truth value (`false` and `ni
33
33
  are `false`, everything else is `true`), and `fail_arguments` are exactly the same
34
34
  as those we would pass to the `fail` or `raise` methods.
35
35
 
36
- The `assert` and `refute` methods do three things. First they test the `truthiness`,
37
- then they tick up the counts in the global assertions counter, and if truthiness fails,
38
- they raise an error. This error is either `StandardError` or the one specified
39
- by the `fail_arguments`.
36
+ The `assert` (and likewise `refute`) method does three things. First it tests the
37
+ `truthiness`, then it ticks up the appropriate counts in the global assertions
38
+ counter, and lastly, if truthiness came up short, it raises an error. This error
39
+ is either `RuntimeError` or the one specified by the `fail_arguments`.
40
40
 
41
- The global assertions counter is `$ASSERTION_COUNTS`. If is simply a Hash formally
41
+ The global assertions counter is `$ASSERTION_COUNTS`. It is simply a Hash formally
42
42
  defined as:
43
43
 
44
44
  $ASSERTIONS_COUNTS = Hash.new{|h,k| h[k] = 0}
45
45
 
46
- And though it is open to any key, they should be symbols and three in particular
47
- and standard `:pass`, `:fail` and `:total`. Whenever an assertion passes,
48
- the `:total` and `:pass` counts are incremented, and whenever an assertion
49
- fails the `:total` and `:fail` counts are incremented. You might wonder why
46
+ And though it is open to any key, the keys should be symbols. Three keys in
47
+ particular and standard: `:pass`, `:fail` and `:total`. Whenever an assertion
48
+ passes, the `:pass` and `:total` counts are incremented, and whenever an assertion
49
+ fails the `:fail` and `:total` counts are incremented. You might wonder why
50
50
  there is a total entry when the sum of the other two would do just as well.
51
- Well, other frameworks might want to add some other counts, e.g. a `:skip`
52
- count, and to ensure we still get the proper total despite this, we keep
53
- a separate tally. Moving on....
51
+ Well, other frameworks might want to add other counts, such as `:skip`. So
52
+ to ensure we still get the proper total despite this, we keep a separate tally.
53
+ Moving on....
54
54
 
55
55
  Okay, last thing. When `assert` or `refute` raises an error, it marks the error
56
- as an assertion via the `Exception#set_assertion` method. This is a method extension
57
- to the Exception class along with the `Exception#assertion?` method which any
58
- test framework can use to distinguish an assertion error from an ordinarily error.
56
+ as an assertion via the `#set_assertion` method. This is a method extension
57
+ to the Exception class along with the `#assertion?` method which any
58
+ test framework can use to distinguish an assertion error from an ordinarily
59
+ error.
59
60
 
60
- That's all, bro. Consider your brass ass informed.
61
+ And that's all there is to it. If you *capice* then consider yourself top brass.
61
62
 
63
+ Love, Peace and Brass Knuckles
62
64
 
63
- ## COPYING
64
65
 
65
- Copyright (c) 2010 Rubyworks
66
+ ## COPYING
66
67
 
67
- All rights reserved.
68
+ Copyright (c) 2010 Rubyworks. All rights reserved.
68
69
 
69
70
  Distribute in accordance with the **BSD-2-Clause** license.
70
71
 
@@ -78,7 +78,7 @@ module Kernel
78
78
  error_class = raise_arguments.shift
79
79
  error_class.new(*raise_arguments)
80
80
  else
81
- error_class = StandardError
81
+ error_class = RuntimeError
82
82
  error_class.new(*raise_arguments)
83
83
  end
84
84
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brass
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-01-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: detroit
16
- requirement: &19650860 !ruby/object:Gem::Requirement
16
+ requirement: &16988520 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *19650860
24
+ version_requirements: *16988520
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: lemon
27
- requirement: &19650020 !ruby/object:Gem::Requirement
27
+ requirement: &16987480 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *19650020
35
+ version_requirements: *16987480
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rubytest
38
- requirement: &19649060 !ruby/object:Gem::Requirement
38
+ requirement: &16986520 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *19649060
46
+ version_requirements: *16986520
47
47
  description: ! 'BRASS stands for Bare-Metal Ruby Assertion System Standard. It is
48
48
  a very basic
49
49
 
@@ -60,6 +60,7 @@ extra_rdoc_files:
60
60
  - README.md
61
61
  files:
62
62
  - .ruby
63
+ - .yardopts
63
64
  - lib/brass/expect.rb
64
65
  - lib/brass.rb
65
66
  - test/case_brass.rb