mackarel 0.1.2 → 0.2.0

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: beeb1dcbd9084fad7cfc52b9ab8472f9c5b093fd
4
- data.tar.gz: d867ff98a44c58a720df52a89c84e0ecc0c56885
3
+ metadata.gz: 3586a894fc59fef0cf448861108eaf3e4f2fc919
4
+ data.tar.gz: a2d6d116d74891a6700ac83be576a3f62121ef85
5
5
  SHA512:
6
- metadata.gz: 448417cf471b93dd8c9d60496f28408e8e086b920239fb8abcd6f9bb17e4aecb2c6af926bbaa8a959267ee61a2b99a5f95b036c2072958c1f88eff9bbb50bbc1
7
- data.tar.gz: 6ccea1cb9203198dc69200da1863474781c6673387ebefd537345e79caa1ac958440eeb6119f882b0be2566675f7e8dfb6cd6601a2b8b75cef9e52f27a6aa755
6
+ metadata.gz: d08c818c81b06b7660e6749d77df88199ce5b9243153e3e0c575f5fffc6d0f4fb33189ecd3e45d59543679793e996638ac0c1b72318e4cbf6e843d121ae2ea4b
7
+ data.tar.gz: 462eefd29b91fcb32011fad7ec8b2e16d6f11d8090eaa5a61a58c3b50f6118b0b8c41378ad7a870054e6f56952dee5a87fab2ea46fe8bb9d620a27dd6a79873c
data/Guardfile ADDED
@@ -0,0 +1,15 @@
1
+ guard :rspec, cmd: "bundle exec rspec" do
2
+ require "guard/rspec/dsl"
3
+ dsl = Guard::RSpec::Dsl.new(self)
4
+
5
+ # RSpec files
6
+ rspec = dsl.rspec
7
+ watch(rspec.spec_helper) { rspec.spec_dir }
8
+ watch(rspec.spec_support) { rspec.spec_dir }
9
+ watch(rspec.spec_files)
10
+
11
+ # Ruby files
12
+ ruby = dsl.ruby
13
+ dsl.watch_spec_files_for(ruby.lib_files)
14
+
15
+ end
@@ -27,6 +27,11 @@ module Mackarel
27
27
  page.find("form#{selector}").find(:button).click
28
28
  end
29
29
 
30
+ def i_am_taken_to(path)
31
+ expect(current_path).to eq path
32
+ end
33
+
34
+
30
35
  def i_can_see(something)
31
36
  expect(page).to have_content(something)
32
37
  end
@@ -71,11 +76,16 @@ module Mackarel
71
76
  "contains(@src, '#{src}')" if src
72
77
  end
73
78
 
79
+ alias i_am_taken_to_the i_am_taken_to
80
+ alias and_i_am_taken_to i_am_taken_to
81
+ alias and_i_am_taken_to_the i_am_taken_to
82
+
74
83
  alias and_i_find i_find
75
84
  alias i_find_a i_find
76
85
  alias i_find_an i_find
77
86
  alias and_i_find_an i_find
78
87
  alias and_i_find_a i_find
88
+
79
89
  alias and_i_can_see i_can_see
80
90
  end
81
91
  end
data/lib/mackarel/core.rb CHANGED
@@ -4,28 +4,30 @@ module Mackarel
4
4
  yield
5
5
  end
6
6
 
7
- def i_am_taken_to(path)
8
- expect(current_path).to eq path
9
- end
10
-
11
7
  def when_there_exists_a(factory, overrides={})
12
8
  called = overrides.delete(:called) || factory
13
- instance_variable_set("@#{called}", FactoryGirl.create(factory, overrides))
9
+ asset = FactoryGirl.create(factory, overrides)
10
+ instance_variable_set("@#{called}", asset)
11
+ yield(asset) if block_given?
14
12
  end
15
13
 
16
14
  def when_there_exist(number, factory, overrides={})
17
- called = overrides.delete(:called) || factory
18
- instance_variable_set("@#{called}", FactoryGirl.create_list(factory, number, overrides))
15
+ called = overrides.delete(:called)
16
+ asset = FactoryGirl.create_list(factory, number, overrides)
17
+ if called
18
+ instance_variable_set("@#{called}", asset)
19
+ else
20
+ instance_variable_set("@#{factory}", asset)
21
+ instance_variable_set("@#{factory}_list", asset)
22
+ end
23
+
24
+ yield(asset) if block_given?
19
25
  end
20
26
 
21
27
  alias and_i when_i
22
28
  alias and_also when_i
23
29
  alias given when_i
24
30
 
25
- alias i_am_taken_to_the i_am_taken_to
26
- alias and_i_am_taken_to i_am_taken_to
27
- alias and_i_am_taken_to_the i_am_taken_to
28
-
29
31
  alias when_there_exists_an when_there_exists_a
30
32
  alias and_there_exists_a when_there_exists_a
31
33
  alias and_there_exists_an when_there_exists_a
@@ -1,3 +1,3 @@
1
1
  module Mackarel
2
- VERSION = "0.1.2"
2
+ VERSION = "0.2.0"
3
3
  end
data/mackarel.gemspec CHANGED
@@ -26,6 +26,8 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency "rack"
27
27
  spec.add_development_dependency "nokogiri"
28
28
  spec.add_development_dependency "rack-test"
29
+ spec.add_development_dependency "guard"
30
+ spec.add_development_dependency "guard-rspec"
29
31
 
30
32
  spec.add_dependency "rspec", "~> 3"
31
33
  spec.add_dependency "capybara", "~> 2"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mackarel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paolo Gianrossi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-16 00:00:00.000000000 Z
11
+ date: 2017-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -136,6 +136,34 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: guard
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: guard-rspec
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
139
167
  - !ruby/object:Gem::Dependency
140
168
  name: rspec
141
169
  requirement: !ruby/object:Gem::Requirement
@@ -206,6 +234,7 @@ files:
206
234
  - ".travis.yml"
207
235
  - CODE_OF_CONDUCT.md
208
236
  - Gemfile
237
+ - Guardfile
209
238
  - LICENSE.txt
210
239
  - README.md
211
240
  - Rakefile
@@ -237,7 +266,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
237
266
  version: '0'
238
267
  requirements: []
239
268
  rubyforge_project:
240
- rubygems_version: 2.5.1
269
+ rubygems_version: 2.6.11
241
270
  signing_key:
242
271
  specification_version: 4
243
272
  summary: Simple feature testing for Rails with Capybara and Rspec