pickle-mongodb 0.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 330921d2e15636d82ce5d133a7b722f3fd13b222
4
- data.tar.gz: 15714d41ac39e550baf1677639b2929367548c30
3
+ metadata.gz: 9925229f75a19e5386e0b1fe90a573fce36db328
4
+ data.tar.gz: 4c0762e9d23d04f9ac184db42cc4058aa5e694e7
5
5
  SHA512:
6
- metadata.gz: 7c4a744e4d7596b5bf651234894dde4119a1f80dee5bd755bfef97b0cb86cfda962c1c5ee4dd07c64aa5adf0493b392cf49c716c70a99c1d89ef7fe62959e82d
7
- data.tar.gz: d2ba451a0440a527828d1f1449391a2169c47842267f4cb87790d644a0bfea4e162ef969475450f7eb526f58f06cd8c98e400a07d5119a73aa5790003b8f452e
6
+ metadata.gz: a146b87aaa671d55f807f00f94fcfbba155b0642ef6181592a83d4fc2aadfde4dcc972a481d8c17c37c4afe5246198a7f8366f64824d6d3cdca5ce39f76a1537
7
+ data.tar.gz: 90a9c33c58dc73c25b45827e2cd608ac189cb502bd95f85cc60bcae48f91b518ff516e29323329f7e6b561733b0624139080ce08f33e5111723eb93c3c66c246
@@ -0,0 +1,62 @@
1
+ # this file generated by script/generate pickle
2
+
3
+ # create a model
4
+ Given(/^#{capture_model} exists?(?: with #{capture_fields})?$/) do |name, fields|
5
+ create_model(name, fields)
6
+ end
7
+
8
+ # create n models
9
+ Given(/^(\d+) #{capture_plural_factory} exist(?: with #{capture_fields})?$/) do |count, plural_factory, fields|
10
+ count.to_i.times { create_model(plural_factory.singularize, fields) }
11
+ end
12
+
13
+ # create models from a table
14
+ Given /^the following #{capture_plural_factory} exist$/ do |plural_factory, table|
15
+ name = plural_factory.singularize
16
+ table.hashes.each { |hash| create_model(name, hash) }
17
+ end
18
+
19
+ # find a model
20
+ Then(/^#{capture_model} should exist(?: with #{capture_fields})?$/) do |name, fields|
21
+ find_model(name, fields).should_not be_nil
22
+ end
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
+
29
+ # find exactly n models
30
+ Then(/^(\d+) #{capture_plural_factory} should exist(?: with #{capture_fields})?$/) do |count, plural_factory, fields|
31
+ find_models(plural_factory.singularize, fields).size.should == count.to_i
32
+ end
33
+
34
+ # assert model is in another model's has_many assoc
35
+ Then(/^#{capture_model} should be (?:in|one of|amongst) #{capture_model}'s (\w+)$/) do |target, owner, association|
36
+ model(owner).send(association).should include(model(target))
37
+ end
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
+
44
+ # assert model is another model's has_one/belongs_to assoc
45
+ Then(/^#{capture_model} should be #{capture_model}'s (\w+)$/) do |target, owner, association|
46
+ model(owner).send(association).should == model(target)
47
+ end
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
+
54
+ # assert model.predicate?
55
+ Then(/^#{capture_model} should (?:be|have) (?:an? )?#{capture_predicate}$/) do |name, predicate|
56
+ model(name).should send("be_#{predicate.gsub(' ', '_')}")
57
+ end
58
+
59
+ # assert not model.predicate?
60
+ Then(/^#{capture_model} should not (?:be|have) (?:an? )?#{capture_predicate}$/) do |name, predicate|
61
+ model(name).should_not send("be_#{predicate.gsub(' ', '_')}")
62
+ end
@@ -3,6 +3,18 @@ require 'factory_girl'
3
3
  require 'pickle/world'
4
4
  require 'rspec'
5
5
  require 'cucumber/pickle_mongodb/finders.rb'
6
+ require 'cucumber/pickle_mongodb/version.rb'
7
+
8
+ module Cucumber
9
+ module PickleMongoDB
10
+ def self.pickle_steps
11
+ t = ["#{File.dirname(File.expand_path($0))}/../lib/#{FOLDER}",
12
+ "#{Gem.dir}/gems/#{NAME}-#{VERSION}/lib/#{FOLDER}"]
13
+ t.each {|i| return "#{i}/pickle_steps.rb" if File.readable?(i) }
14
+ raise "both paths are invalid: #{t}"
15
+ end
16
+ end
17
+ end
6
18
 
7
19
  World(FactoryGirl::Syntax::Methods)
8
20
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pickle-mongodb
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: '0.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nic Jackson
@@ -90,6 +90,7 @@ extra_rdoc_files: []
90
90
  files:
91
91
  - lib/cucumber/pickle_mongodb.rb
92
92
  - lib/cucumber/pickle_mongodb/finders.rb
93
+ - lib/cucumber/pickle_mongodb/pickle_steps.rb
93
94
  homepage: https://github.com/nicholasjackson/pickle-mongodb
94
95
  licenses:
95
96
  - MIT