nutrasuite 0.3.0 → 0.3.1
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/Changelog +9 -0
- data/README.markdown +2 -1
- data/lib/nutrasuite/contexts.rb +12 -3
- data/lib/nutrasuite/version.rb +1 -1
- data/test/unit/contexts_test.rb +8 -0
- metadata +5 -4
data/Changelog
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
0.3.1 [03/18/2012]
|
2
|
+
Root contexts were kind of a dumb idea it turns out. Found an alternate way to
|
3
|
+
implement similar functionality.
|
4
|
+
0.3.0 [03/07/2012]
|
5
|
+
Change log started. Better late than never.
|
6
|
+
Removed deprecated "setup" and "teardown" methods.
|
7
|
+
Introduced the concept of a root context so "before" and "after" methods can
|
8
|
+
exist outside of a declared context.
|
9
|
+
Replaced the ill-conceived "and" method with "and_also" courtesy @gma.
|
data/README.markdown
CHANGED
data/lib/nutrasuite/contexts.rb
CHANGED
@@ -3,7 +3,6 @@ module Nutrasuite
|
|
3
3
|
# Public: ContextHelpers contains all of the Nutrasuite Context methods. This
|
4
4
|
# will be included in Test::Unit::TestCase by default.
|
5
5
|
module ContextHelpers
|
6
|
-
|
7
6
|
# Public: These methods will each define a context and push it onto the
|
8
7
|
# context stack for the duration of the passed in block.
|
9
8
|
#
|
@@ -32,7 +31,12 @@ module Nutrasuite
|
|
32
31
|
# Public: use before to declare steps that need to be run before every test
|
33
32
|
# in a context.
|
34
33
|
def before(&block)
|
35
|
-
Context.current_context
|
34
|
+
if Context.current_context
|
35
|
+
Context.current_context.setups << block
|
36
|
+
else
|
37
|
+
puts self.name + " is adding a hook"
|
38
|
+
self.add_setup_hook(nil, &block)
|
39
|
+
end
|
36
40
|
end
|
37
41
|
|
38
42
|
# Public: use after to declare steps that need to be run after every test in
|
@@ -89,6 +93,11 @@ module Nutrasuite
|
|
89
93
|
test_name = Context.build_test_name(name)
|
90
94
|
|
91
95
|
setups = []
|
96
|
+
# Be sure to include setup hooks from minitest.
|
97
|
+
unless @setup_hooks.nil?
|
98
|
+
setups = setups + @setup_hooks
|
99
|
+
end
|
100
|
+
|
92
101
|
teardowns = []
|
93
102
|
Context.context_stack.each do |context|
|
94
103
|
setups.concat(context.setups)
|
@@ -188,7 +197,7 @@ module Nutrasuite
|
|
188
197
|
#
|
189
198
|
# Returns: an Array representing the context stack.
|
190
199
|
def self.context_stack
|
191
|
-
@context_stack ||= [
|
200
|
+
@context_stack ||= []
|
192
201
|
end
|
193
202
|
|
194
203
|
# Internal: get the current context.
|
data/lib/nutrasuite/version.rb
CHANGED
data/test/unit/contexts_test.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nutrasuite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-03-
|
13
|
+
date: 2012-03-18 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
17
|
-
requirement: &
|
17
|
+
requirement: &70261346101020 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,7 +22,7 @@ dependencies:
|
|
22
22
|
version: '0'
|
23
23
|
type: :development
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *70261346101020
|
26
26
|
description: Nutrasuite is a low-calorie syntax sweetener for minitest
|
27
27
|
email:
|
28
28
|
- tommy.morgan@gmail.com
|
@@ -32,6 +32,7 @@ extensions: []
|
|
32
32
|
extra_rdoc_files: []
|
33
33
|
files:
|
34
34
|
- .gitignore
|
35
|
+
- Changelog
|
35
36
|
- Gemfile
|
36
37
|
- README.markdown
|
37
38
|
- Rakefile
|