pickle 0.1.20 → 0.1.21
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -0
- data/VERSION +1 -1
- data/features/pickle/create_from_active_record.feature +1 -0
- data/features/pickle/create_from_factory_girl.feature +5 -0
- data/features/step_definitions/pickle_steps.rb +15 -0
- data/pickle.gemspec +2 -2
- data/rails_generators/pickle/templates/pickle_steps.rb +15 -0
- metadata +2 -2
data/History.txt
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.21
|
@@ -12,6 +12,7 @@ Feature: I can easily create models from my blueprints
|
|
12
12
|
Given a user exists with name: "Fred", status: "crayzee"
|
13
13
|
Then a user should exist with name: "Fred"
|
14
14
|
And a user should exist with status: "crayzee"
|
15
|
+
But a user should not exist with name: "Wilma"
|
15
16
|
|
16
17
|
Scenario: I create a user via a mapping
|
17
18
|
Given I exist with status: "pwned", name: "fred"
|
@@ -28,6 +28,11 @@ Feature: I can easily create models from my factories
|
|
28
28
|
Then the first tine should be in fork "one"'s tines
|
29
29
|
And the 2nd tine should be in fork: "one"'s tines
|
30
30
|
And the last tine should be in the fancy fork's tines
|
31
|
+
And the fancy fork should be the last tine's fork
|
32
|
+
|
33
|
+
But the first tine should not be in the fancy fork's tines
|
34
|
+
And the last tine should not be in fork "one"'s tines
|
35
|
+
And the fancy fork should not be the first tine's fork
|
31
36
|
|
32
37
|
Scenario: I create a fork with a tine, and find the tine by the fork
|
33
38
|
Given a fork exists
|
@@ -21,6 +21,11 @@ Then(/^#{capture_model} should exist(?: with #{capture_fields})?$/) do |name, fi
|
|
21
21
|
find_model(name, fields).should_not be_nil
|
22
22
|
end
|
23
23
|
|
24
|
+
# not find a model
|
25
|
+
Then(/^#{capture_model} should not exist(?: with #{capture_fields})?$/) do |name, fields|
|
26
|
+
find_model(name, fields).should be_nil
|
27
|
+
end
|
28
|
+
|
24
29
|
# find exactly n models
|
25
30
|
Then(/^(\d+) #{capture_plural_factory} should exist(?: with #{capture_fields})?$/) do |count, plural_factory, fields|
|
26
31
|
find_models(plural_factory.singularize, fields).size.should == count.to_i
|
@@ -31,11 +36,21 @@ Then(/^#{capture_model} should be (?:in|one of|amongst) #{capture_model}'s (\w+)
|
|
31
36
|
model(owner).send(association).should include(model(target))
|
32
37
|
end
|
33
38
|
|
39
|
+
# assert model is not in another model's has_many assoc
|
40
|
+
Then(/^#{capture_model} should not be (?:in|one of|amongst) #{capture_model}'s (\w+)$/) do |target, owner, association|
|
41
|
+
model(owner).send(association).should_not include(model(target))
|
42
|
+
end
|
43
|
+
|
34
44
|
# assert model is another model's has_one/belongs_to assoc
|
35
45
|
Then(/^#{capture_model} should be #{capture_model}'s (\w+)$/) do |target, owner, association|
|
36
46
|
model(owner).send(association).should == model(target)
|
37
47
|
end
|
38
48
|
|
49
|
+
# assert model is not another model's has_one/belongs_to assoc
|
50
|
+
Then(/^#{capture_model} should not be #{capture_model}'s (\w+)$/) do |target, owner, association|
|
51
|
+
model(owner).send(association).should_not == model(target)
|
52
|
+
end
|
53
|
+
|
39
54
|
# assert model.predicate?
|
40
55
|
Then(/^#{capture_model} should (?:be|have) (?:an? )?#{capture_predicate}$/) do |name, predicate|
|
41
56
|
model(name).should send("be_#{predicate.gsub(' ', '_')}")
|
data/pickle.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{pickle}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.21"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Ian White"]
|
12
|
-
s.date = %q{2009-10-
|
12
|
+
s.date = %q{2009-10-28}
|
13
13
|
s.description = %q{Easy model creation and reference in your cucumber features}
|
14
14
|
s.email = %q{ian.w.white@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -21,6 +21,11 @@ Then(/^#{capture_model} should exist(?: with #{capture_fields})?$/) do |name, fi
|
|
21
21
|
find_model(name, fields).should_not be_nil
|
22
22
|
end
|
23
23
|
|
24
|
+
# not find a model
|
25
|
+
Then(/^#{capture_model} should not exist(?: with #{capture_fields})?$/) do |name, fields|
|
26
|
+
find_model(name, fields).should be_nil
|
27
|
+
end
|
28
|
+
|
24
29
|
# find exactly n models
|
25
30
|
Then(/^(\d+) #{capture_plural_factory} should exist(?: with #{capture_fields})?$/) do |count, plural_factory, fields|
|
26
31
|
find_models(plural_factory.singularize, fields).size.should == count.to_i
|
@@ -31,11 +36,21 @@ Then(/^#{capture_model} should be (?:in|one of|amongst) #{capture_model}'s (\w+)
|
|
31
36
|
model(owner).send(association).should include(model(target))
|
32
37
|
end
|
33
38
|
|
39
|
+
# assert model is not in another model's has_many assoc
|
40
|
+
Then(/^#{capture_model} should not be (?:in|one of|amongst) #{capture_model}'s (\w+)$/) do |target, owner, association|
|
41
|
+
model(owner).send(association).should_not include(model(target))
|
42
|
+
end
|
43
|
+
|
34
44
|
# assert model is another model's has_one/belongs_to assoc
|
35
45
|
Then(/^#{capture_model} should be #{capture_model}'s (\w+)$/) do |target, owner, association|
|
36
46
|
model(owner).send(association).should == model(target)
|
37
47
|
end
|
38
48
|
|
49
|
+
# assert model is not another model's has_one/belongs_to assoc
|
50
|
+
Then(/^#{capture_model} should not be #{capture_model}'s (\w+)$/) do |target, owner, association|
|
51
|
+
model(owner).send(association).should_not == model(target)
|
52
|
+
end
|
53
|
+
|
39
54
|
# assert model.predicate?
|
40
55
|
Then(/^#{capture_model} should (?:be|have) (?:an? )?#{capture_predicate}$/) do |name, predicate|
|
41
56
|
model(name).should send("be_#{predicate.gsub(' ', '_')}")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pickle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian White
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-10-
|
12
|
+
date: 2009-10-28 00:00:00 +00:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|