stories 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +1 -1
- data/lib/stories.rb +1 -1
- data/lib/stories/runner.rb +26 -28
- data/lib/stories/runner/pdf.rb +1 -1
- metadata +3 -3
data/README.markdown
CHANGED
@@ -50,7 +50,7 @@ If you are using Rails, you can use stories for your integration tests with Webr
|
|
50
50
|
|
51
51
|
This will produce the following output:
|
52
52
|
|
53
|
-
- As a user I want to
|
53
|
+
- As a user I want to log in so that I can access restricted features
|
54
54
|
Using good information
|
55
55
|
Go to “/”
|
56
56
|
Click “Log in”
|
data/lib/stories.rb
CHANGED
data/lib/stories/runner.rb
CHANGED
@@ -2,40 +2,38 @@
|
|
2
2
|
|
3
3
|
require 'test/unit/ui/console/testrunner'
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
alias original_story story
|
10
|
-
alias original_scenario scenario
|
11
|
-
|
12
|
-
def story(name, &block)
|
13
|
-
story = Stories::Story.new(name)
|
14
|
-
|
15
|
-
original_story(name) do
|
16
|
-
@@story = story
|
17
|
-
|
18
|
-
def self.story; @@story; end
|
5
|
+
module Stories
|
6
|
+
def self.all
|
7
|
+
@all ||= {}
|
8
|
+
end
|
19
9
|
|
20
|
-
|
21
|
-
|
10
|
+
module TestCase
|
11
|
+
def self.included(base)
|
12
|
+
class << base
|
13
|
+
def story(name, *args, &block)
|
14
|
+
context(name, *args) do
|
15
|
+
Stories.all[self] = Stories::Story.new(name)
|
16
|
+
class_eval(&block) if block_given?
|
17
|
+
end
|
18
|
+
end
|
22
19
|
|
23
|
-
|
24
|
-
|
20
|
+
def scenario(name, *args, &block)
|
21
|
+
scenario = Stories::Scenario.new(name)
|
25
22
|
|
26
|
-
|
27
|
-
scenario = Stories::Scenario.new(name)
|
23
|
+
Stories.all[self].scenarios << scenario
|
28
24
|
|
29
|
-
|
30
|
-
|
31
|
-
|
25
|
+
test(name) do
|
26
|
+
@scenario = scenario
|
27
|
+
instance_eval(&block)
|
28
|
+
end
|
29
|
+
end
|
32
30
|
end
|
33
|
-
|
34
|
-
self.story.scenarios << scenario
|
35
31
|
end
|
36
32
|
end
|
37
33
|
end
|
38
34
|
|
35
|
+
Test::Unit::TestCase.send(:include, Stories::TestCase)
|
36
|
+
|
39
37
|
module Test::Unit::Assertions
|
40
38
|
def report(text, &block)
|
41
39
|
@scenario.steps << text
|
@@ -86,7 +84,7 @@ module Stories
|
|
86
84
|
def finished(elapsed_time)
|
87
85
|
puts
|
88
86
|
|
89
|
-
|
87
|
+
Stories.all.values.to_a.each_with_index do |story,i|
|
90
88
|
puts "- #{story.name}"
|
91
89
|
|
92
90
|
story.scenarios.each do |scenario|
|
@@ -105,11 +103,11 @@ module Stories
|
|
105
103
|
end
|
106
104
|
end
|
107
105
|
|
108
|
-
puts unless i + 1 ==
|
106
|
+
puts unless i + 1 == Stories.all.values.size
|
109
107
|
end
|
110
108
|
|
111
109
|
super
|
112
|
-
puts "%d stories, %d scenarios" % [
|
110
|
+
puts "%d stories, %d scenarios" % [Stories.all.values.size, Stories.all.values.inject(0) {|total,s| total + s.scenarios.size }]
|
113
111
|
end
|
114
112
|
end
|
115
113
|
|
data/lib/stories/runner/pdf.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stories
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Damian Janowski
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-
|
13
|
+
date: 2009-08-25 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
68
68
|
requirements: []
|
69
69
|
|
70
70
|
rubyforge_project: stories
|
71
|
-
rubygems_version: 1.3.
|
71
|
+
rubygems_version: 1.3.5
|
72
72
|
signing_key:
|
73
73
|
specification_version: 3
|
74
74
|
summary: Write Stories and User Acceptance Tests using the minimalist testing framework Contest.
|