cucumber_factory 1.7.0 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +7 -0
- data/Gemfile.lock +54 -0
- data/README.rdoc +1 -1
- data/VERSION +1 -1
- data/cucumber_factory.gemspec +10 -4
- data/lib/cucumber/factory.rb +1 -1
- data/spec/app_root/app/models/people/actor.rb +2 -0
- data/spec/app_root/db/migrate/004_create_actors.rb +12 -0
- data/spec/factory_spec.rb +4 -0
- data/spec/steps_spec.rb +6 -0
- metadata +10 -4
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
cucumber_factory (1.7.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: http://rubygems.org/
|
8
|
+
specs:
|
9
|
+
actionmailer (2.3.8)
|
10
|
+
actionpack (= 2.3.8)
|
11
|
+
actionpack (2.3.8)
|
12
|
+
activesupport (= 2.3.8)
|
13
|
+
rack (~> 1.1.0)
|
14
|
+
activerecord (2.3.8)
|
15
|
+
activesupport (= 2.3.8)
|
16
|
+
activeresource (2.3.8)
|
17
|
+
activesupport (= 2.3.8)
|
18
|
+
activesupport (2.3.8)
|
19
|
+
builder (2.1.2)
|
20
|
+
cucumber (0.8.3)
|
21
|
+
builder (~> 2.1.2)
|
22
|
+
diff-lcs (~> 1.1.2)
|
23
|
+
gherkin (~> 2.0.2)
|
24
|
+
json_pure (~> 1.4.3)
|
25
|
+
term-ansicolor (~> 1.0.4)
|
26
|
+
diff-lcs (1.1.2)
|
27
|
+
gherkin (2.0.2)
|
28
|
+
trollop (~> 1.16.2)
|
29
|
+
json_pure (1.4.6)
|
30
|
+
rack (1.1.0)
|
31
|
+
rails (2.3.8)
|
32
|
+
actionmailer (= 2.3.8)
|
33
|
+
actionpack (= 2.3.8)
|
34
|
+
activerecord (= 2.3.8)
|
35
|
+
activeresource (= 2.3.8)
|
36
|
+
activesupport (= 2.3.8)
|
37
|
+
rake (>= 0.8.3)
|
38
|
+
rake (0.8.7)
|
39
|
+
rspec (1.2.9)
|
40
|
+
rspec-rails (1.2.9)
|
41
|
+
rack (>= 1.0.0)
|
42
|
+
rspec (>= 1.2.9)
|
43
|
+
term-ansicolor (1.0.5)
|
44
|
+
trollop (1.16.2)
|
45
|
+
|
46
|
+
PLATFORMS
|
47
|
+
ruby
|
48
|
+
|
49
|
+
DEPENDENCIES
|
50
|
+
cucumber (= 0.8.3)
|
51
|
+
cucumber_factory!
|
52
|
+
rails (= 2.3.8)
|
53
|
+
rspec (= 1.2.9)
|
54
|
+
rspec-rails (= 1.2.9)
|
data/README.rdoc
CHANGED
@@ -27,7 +27,7 @@ Boolean attributes can be set by appending "which", "that" or "who" at the end:
|
|
27
27
|
And there is a director who is popular
|
28
28
|
|
29
29
|
Instead of "and" you can also use "but" and commas to join sentences:
|
30
|
-
|
30
|
+
Given there is a movie which is awesome, popular and successful but not science fiction
|
31
31
|
And there is a director with the income "500000" but with the account balance "-30000"
|
32
32
|
|
33
33
|
== Factory support
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.7.
|
1
|
+
1.7.1
|
data/cucumber_factory.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{cucumber_factory}
|
8
|
-
s.version = "1.7.
|
8
|
+
s.version = "1.7.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Henning Koch"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-11-05}
|
13
13
|
s.description = %q{Cucumber Factory allows you to create ActiveRecord models from your Cucumber features without writing step definitions for each model.}
|
14
14
|
s.email = %q{github@makandra.de}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -17,6 +17,8 @@ Gem::Specification.new do |s|
|
|
17
17
|
]
|
18
18
|
s.files = [
|
19
19
|
".gitignore",
|
20
|
+
"Gemfile",
|
21
|
+
"Gemfile.lock",
|
20
22
|
"MIT-LICENSE",
|
21
23
|
"README.rdoc",
|
22
24
|
"Rakefile",
|
@@ -31,6 +33,7 @@ Gem::Specification.new do |s|
|
|
31
33
|
"spec/app_root/app/models/movie.rb",
|
32
34
|
"spec/app_root/app/models/opera.rb",
|
33
35
|
"spec/app_root/app/models/payment.rb",
|
36
|
+
"spec/app_root/app/models/people/actor.rb",
|
34
37
|
"spec/app_root/app/models/plain_ruby_class.rb",
|
35
38
|
"spec/app_root/app/models/user.rb",
|
36
39
|
"spec/app_root/config/boot.rb",
|
@@ -45,6 +48,7 @@ Gem::Specification.new do |s|
|
|
45
48
|
"spec/app_root/db/migrate/001_create_movies.rb",
|
46
49
|
"spec/app_root/db/migrate/002_create_users.rb",
|
47
50
|
"spec/app_root/db/migrate/003_create_payments.rb",
|
51
|
+
"spec/app_root/db/migrate/004_create_actors.rb",
|
48
52
|
"spec/app_root/lib/console_with_fixtures.rb",
|
49
53
|
"spec/app_root/log/.gitignore",
|
50
54
|
"spec/app_root/script/console",
|
@@ -69,6 +73,7 @@ Gem::Specification.new do |s|
|
|
69
73
|
"spec/app_root/app/models/payment.rb",
|
70
74
|
"spec/app_root/app/models/plain_ruby_class.rb",
|
71
75
|
"spec/app_root/app/models/user.rb",
|
76
|
+
"spec/app_root/app/models/people/actor.rb",
|
72
77
|
"spec/app_root/config/boot.rb",
|
73
78
|
"spec/app_root/config/environment.rb",
|
74
79
|
"spec/app_root/config/environments/in_memory.rb",
|
@@ -80,11 +85,12 @@ Gem::Specification.new do |s|
|
|
80
85
|
"spec/app_root/db/migrate/001_create_movies.rb",
|
81
86
|
"spec/app_root/db/migrate/002_create_users.rb",
|
82
87
|
"spec/app_root/db/migrate/003_create_payments.rb",
|
88
|
+
"spec/app_root/db/migrate/004_create_actors.rb",
|
83
89
|
"spec/app_root/lib/console_with_fixtures.rb",
|
84
90
|
"spec/spec_helper.rb",
|
85
91
|
"spec/step_mother_ext_spec.rb",
|
86
|
-
"spec/
|
87
|
-
"spec/
|
92
|
+
"spec/factory_spec.rb",
|
93
|
+
"spec/steps_spec.rb"
|
88
94
|
]
|
89
95
|
|
90
96
|
if s.respond_to? :specification_version then
|
data/lib/cucumber/factory.rb
CHANGED
@@ -75,7 +75,7 @@ module Cucumber
|
|
75
75
|
|
76
76
|
def model_class_from_prose(prose)
|
77
77
|
# don't use \w which depends on the system locale
|
78
|
-
prose.gsub(/[^A-Za-z0-9_]+/, "_").camelize.constantize
|
78
|
+
prose.gsub(/[^A-Za-z0-9_\/]+/, "_").camelize.constantize
|
79
79
|
end
|
80
80
|
|
81
81
|
def variable_name_from_prose(prose)
|
data/spec/factory_spec.rb
CHANGED
@@ -19,6 +19,10 @@ describe Cucumber::Factory do
|
|
19
19
|
Cucumber::Factory.send(:model_class_from_prose, "job offer").should == JobOffer
|
20
20
|
end
|
21
21
|
|
22
|
+
it "should allow namespaced models" do
|
23
|
+
Cucumber::Factory.send(:model_class_from_prose, "people/actor").should == People::Actor
|
24
|
+
end
|
25
|
+
|
22
26
|
end
|
23
27
|
|
24
28
|
describe 'variable_name_from_prose' do
|
data/spec/steps_spec.rb
CHANGED
@@ -59,6 +59,12 @@ describe 'steps provided by cucumber_factory' do
|
|
59
59
|
@step_mother.invoke("there is a User")
|
60
60
|
end
|
61
61
|
|
62
|
+
it "should instantiate namespaced classes" do
|
63
|
+
actor = People::Actor.new
|
64
|
+
People::Actor.should_receive(:new).and_return(actor)
|
65
|
+
@step_mother.invoke("there is a people/actor")
|
66
|
+
end
|
67
|
+
|
62
68
|
it "should allow either 'a' or 'an' for the article" do
|
63
69
|
Opera.should_receive(:new).with({})
|
64
70
|
@step_mother.invoke("there is an opera")
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 7
|
8
|
-
-
|
9
|
-
version: 1.7.
|
8
|
+
- 1
|
9
|
+
version: 1.7.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Henning Koch
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-11-05 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|
@@ -28,6 +28,8 @@ extra_rdoc_files:
|
|
28
28
|
- README.rdoc
|
29
29
|
files:
|
30
30
|
- .gitignore
|
31
|
+
- Gemfile
|
32
|
+
- Gemfile.lock
|
31
33
|
- MIT-LICENSE
|
32
34
|
- README.rdoc
|
33
35
|
- Rakefile
|
@@ -42,6 +44,7 @@ files:
|
|
42
44
|
- spec/app_root/app/models/movie.rb
|
43
45
|
- spec/app_root/app/models/opera.rb
|
44
46
|
- spec/app_root/app/models/payment.rb
|
47
|
+
- spec/app_root/app/models/people/actor.rb
|
45
48
|
- spec/app_root/app/models/plain_ruby_class.rb
|
46
49
|
- spec/app_root/app/models/user.rb
|
47
50
|
- spec/app_root/config/boot.rb
|
@@ -56,6 +59,7 @@ files:
|
|
56
59
|
- spec/app_root/db/migrate/001_create_movies.rb
|
57
60
|
- spec/app_root/db/migrate/002_create_users.rb
|
58
61
|
- spec/app_root/db/migrate/003_create_payments.rb
|
62
|
+
- spec/app_root/db/migrate/004_create_actors.rb
|
59
63
|
- spec/app_root/lib/console_with_fixtures.rb
|
60
64
|
- spec/app_root/log/.gitignore
|
61
65
|
- spec/app_root/script/console
|
@@ -104,6 +108,7 @@ test_files:
|
|
104
108
|
- spec/app_root/app/models/payment.rb
|
105
109
|
- spec/app_root/app/models/plain_ruby_class.rb
|
106
110
|
- spec/app_root/app/models/user.rb
|
111
|
+
- spec/app_root/app/models/people/actor.rb
|
107
112
|
- spec/app_root/config/boot.rb
|
108
113
|
- spec/app_root/config/environment.rb
|
109
114
|
- spec/app_root/config/environments/in_memory.rb
|
@@ -115,8 +120,9 @@ test_files:
|
|
115
120
|
- spec/app_root/db/migrate/001_create_movies.rb
|
116
121
|
- spec/app_root/db/migrate/002_create_users.rb
|
117
122
|
- spec/app_root/db/migrate/003_create_payments.rb
|
123
|
+
- spec/app_root/db/migrate/004_create_actors.rb
|
118
124
|
- spec/app_root/lib/console_with_fixtures.rb
|
119
125
|
- spec/spec_helper.rb
|
120
126
|
- spec/step_mother_ext_spec.rb
|
121
|
-
- spec/steps_spec.rb
|
122
127
|
- spec/factory_spec.rb
|
128
|
+
- spec/steps_spec.rb
|