citrusbyte-stories 0.0.3 → 0.0.4

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 (2) hide show
  1. data/lib/stories.rb +15 -5
  2. metadata +1 -1
data/lib/stories.rb CHANGED
@@ -2,20 +2,30 @@ require "rubygems"
2
2
  require "contest"
3
3
 
4
4
  class Test::Unit::TestCase
5
+ @@stories = []
6
+
5
7
  class << self
6
8
  alias scenario test
7
9
 
8
10
  def story(name, &block)
9
- $stories << name
11
+ @@stories << name
10
12
  context(name, &block)
11
13
  end
14
+
15
+ def stories
16
+ @@stories
17
+ end
12
18
  end
13
19
  end
14
20
 
15
- $stories = []
16
-
17
21
  at_exit do
18
- unless $stories.empty?
19
- puts $stories.join("\n"); puts
22
+ unless Test::Unit::TestCase.stories.empty?
23
+ puts
24
+
25
+ Test::Unit::TestCase.stories.each do |s|
26
+ puts "- #{s}"
27
+ end
28
+
29
+ puts
20
30
  end
21
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: citrusbyte-stories
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damian Janowski