Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Slightly better output.

  • Loading branch information...
commit 412c60c68c8afdaa9b421e985b448a1782694e4e 1 parent e6af911
Damian Janowski djanowski authored

Showing 3 changed files with 17 additions and 7 deletions. Show diff stats Hide diff stats

  1. +15 5 lib/stories.rb
  2. +1 1  stories.gemspec
  3. +1 1  stories.gemspec.erb
20 lib/stories.rb
@@ -2,20 +2,30 @@
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
2  stories.gemspec
... ... @@ -1,6 +1,6 @@
1 1 Gem::Specification.new do |s|
2 2 s.name = 'stories'
3   - s.version = '0.0.3'
  3 + s.version = '0.0.4'
4 4 s.summary = %{Write stories and user acceptance tests using the minimalist testing framework Contest.}
5 5 s.date = %q{2009-04-30}
6 6 s.authors = ["Damian Janowski", "Michel Martens"]
2  stories.gemspec.erb
... ... @@ -1,6 +1,6 @@
1 1 Gem::Specification.new do |s|
2 2 s.name = 'stories'
3   - s.version = '0.0.3'
  3 + s.version = '0.0.4'
4 4 s.summary = %{Write stories and user acceptance tests using the minimalist testing framework Contest.}
5 5 s.date = %q{2009-04-30}
6 6 s.authors = ["Damian Janowski", "Michel Martens"]

0 comments on commit 412c60c

Please sign in to comment.
Something went wrong with that request. Please try again.