mache 2.1.1 → 3.0.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: f2a6457504e07023cbe3e84e72ef455a22081ecd
4
- data.tar.gz: cce7b3211712bfa08b179b9b9cd8f237eca299b3
3
+ metadata.gz: 140c5404ef81c74103be5b606b9e8bc96602028e
4
+ data.tar.gz: f684a099e524469994a8d6b39d9bd23f0f2fb7b9
5
5
  SHA512:
6
- metadata.gz: 2ca5d81a94c1c56716d9e9411abf47bac750198dd07950d049bbcb4612dcf6ded9e96c3b3eddcb91f428be49846772d179e37074e1aeb8956b880f0dd8fb5e3c
7
- data.tar.gz: 15b0571b00474011618204d7eb7e82fcdbac3d06ccda60f0ea55ca39dc7a05c3206a6e1fd020a31a1dc6eb19ff75df8919727e43f350cd7d4f0fbb7b7dfe906b
6
+ metadata.gz: 4b61dc1430d309738643a23eca9666ec8bd340653beb4d481ebc966e5cd32b5ca5d0d4e2fcc532cbbceefeb3f7764a2c65e5017b1d6073cc3b0d806b2780ef55
7
+ data.tar.gz: '048b1bd8e9c1f2cfd0a8160a82a3338e8330d28fac7107b70c9d4b3c140d5942a4230e7e0c94734f8073a2b1f2bc8280f2f6f82035993c339c19a42831a39dd5'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.0.0
4
+
5
+ - Upgrade capybara.
6
+ - Update documentation.
7
+
3
8
  ## 2.1.1
4
9
 
5
10
  - Fix a bug in the flash helper matchers.
File without changes
data/README.md CHANGED
@@ -5,21 +5,18 @@
5
5
  Mâché (pronounced "mash-ay") is a tool that helps you to write cleaner and more
6
6
  expressive acceptance tests for your Ruby web applications using page objects.
7
7
 
8
- ## Table of contents
9
-
10
- * [Mâché](#mâché)
11
- * [Table of contents](#table-of-contents)
12
- * [What is a page object?](#what-is-a-page-object)
13
- * [Getting started](#getting-started)
14
- * [Elements](#elements)
15
- * [Components](#components)
16
- * [Helpers](#helpers)
17
- * [Example](#example)
18
- * [API documentation](#api-documentation)
19
- * [Contributing](#contributing)
20
- * [License](#license)
21
-
22
- ## What is a page object?
8
+ ## Table of Contents
9
+
10
+ * [What is a Page Object?](#what-is-a-page-object)
11
+ * [Getting Started](#getting-started)
12
+ * [Elements](#elements)
13
+ * [Components](#components)
14
+ * [Helpers](#helpers)
15
+ * [Examples](#examples)
16
+ * [Documentation](#documentation)
17
+ * [License](#license)
18
+
19
+ ## What is a Page Object?
23
20
 
24
21
  A [page object](https://martinfowler.com/bliki/PageObject.html) is a data
25
22
  structure that provides an interface to your web application for the purposes
@@ -39,12 +36,12 @@ low-level API methods like `find`, `fill_in`, and `click_button`, but it
39
36
  doesn't provide us with high-level methods to do things like "sign in to the
40
37
  app" or "click the Dashboard item in the navigation bar".
41
38
 
42
- This is where page objects come in. Using Mâché we can for instance define a
43
- page object class called `SignInPage` and use it any time we want to automate
39
+ This is where page objects come in. Using Mâché, we can define a page object
40
+ class called `SignInPage` and use it any time we want to automate
44
41
  authenticating with our app. It could handle visiting the sign in page,
45
42
  entering the user's credentials, and clicking the "Sign in" button.
46
43
 
47
- ## Getting started
44
+ ## Getting Started
48
45
 
49
46
  Let's dive straight in and take a look at an example. Consider the following
50
47
  HTML fragment for the welcome page in our app:
@@ -216,7 +213,7 @@ class WelcomePage < Mache::Page
216
213
  end
217
214
  ```
218
215
 
219
- ## Example
216
+ ## Examples
220
217
 
221
218
  Let's look at an example of an acceptance test for our `WelcomePage`. Note that
222
219
  the `Header`, `NavItem`, and `Nav` components can be reused in any other page
@@ -287,19 +284,10 @@ feature "Welcome page" do
287
284
  end
288
285
  ```
289
286
 
290
- ## API documentation
291
-
292
- Read the [API documentation](http://www.rubydoc.info/gems/mache) on RubyDoc.
293
-
294
- ## Contributing
287
+ ## Documentation
295
288
 
296
- Pull requests are welcome. Please ensure that you run the tests before
297
- submitting your PR:
298
-
299
- ```
300
- > bundle exec rake
301
- ```
289
+ Read the [API reference](http://www.rubydoc.info/gems/mache) on RubyDoc.
302
290
 
303
291
  ## License
304
292
 
305
- Mâché is licensed under the [MIT License](/LICENSE).
293
+ Mâché is licensed under the [MIT License](/LICENSE.md).
data/lib/mache/dsl.rb CHANGED
@@ -55,7 +55,7 @@ module Mache
55
55
  #
56
56
  module ClassMethods
57
57
  def automation(*ids)
58
- ids.map { |id| %([data-automation="#{id}"]) }.join(" ")
58
+ ids.map { |id| %([data-automation="#{id}"]) }.join(' ')
59
59
  end
60
60
 
61
61
  # Defines an element that wraps an HTML fragment.
@@ -96,7 +96,7 @@ module Mache
96
96
  # @param options [Hash] a hash of options to pass to the Capybara finder
97
97
  def component(name, klass, selector, options = {})
98
98
  unless klass < Node
99
- raise ArgumentError, "Must be given a subclass of Node"
99
+ raise ArgumentError, 'Must be given a subclass of Node'
100
100
  end
101
101
 
102
102
  define_method(name.to_s) do
@@ -114,7 +114,7 @@ module Mache
114
114
  # @param options [Hash] a hash of options to pass to the Capybara finder
115
115
  def components(name, klass, selector, options = {})
116
116
  unless klass < Node
117
- raise ArgumentError, "Must be given a subclass of Node"
117
+ raise ArgumentError, 'Must be given a subclass of Node'
118
118
  end
119
119
 
120
120
  options = {minimum: 1}.merge(options)
@@ -4,7 +4,7 @@ module Mache
4
4
  # The {Flash} module can be Included into page object classes that support
5
5
  # flash behaviour.
6
6
  #
7
- # rubocop:disable Style/PredicateName
7
+ # rubocop:disable Naming/PredicateName
8
8
  module Flash
9
9
  def self.included(base)
10
10
  base.extend(ClassMethods)
@@ -18,18 +18,18 @@ module Mache
18
18
 
19
19
  # Tests whether the page has a flash message.
20
20
  #
21
- # @param [String, Symbol] type a flash message type
22
- # @param [Regexp, String] text a value to match
21
+ # @param type [String, Symbol] a flash message type
22
+ # @param text [Regexp, String] a value to match
23
23
  # @return `true` if the page has a matching message, `false` otherwise
24
24
  def has_message?(type, text)
25
- css_class = flash[:class] || ""
25
+ css_class = flash[:class] || ''
26
26
  regexp = text.is_a?(String) ? /\A#{Regexp.escape(text)}\Z/ : text
27
27
  css_class.include?(type.to_s) && flash.text.strip =~ regexp
28
28
  end
29
29
 
30
30
  # Tests whether the page has a success message.
31
31
  #
32
- # @param [Regexp, String] text a value to match
32
+ # @param text [Regexp, String] a value to match
33
33
  # @return `true` if the page has a matching message, `false` otherwise
34
34
  def has_success_message?(text)
35
35
  has_message?(:success, text)
@@ -37,7 +37,7 @@ module Mache
37
37
 
38
38
  # Tests whether the page has a notice message.
39
39
  #
40
- # @param [Regexp, String] text a value to match
40
+ # @param text [Regexp, String] a value to match
41
41
  # @return `true` if the page has a matching message, `false` otherwise
42
42
  def has_notice_message?(text)
43
43
  has_message?(:notice, text)
@@ -45,7 +45,7 @@ module Mache
45
45
 
46
46
  # Tests whether the page has an alert message.
47
47
  #
48
- # @param [Regexp, String] text a value to match
48
+ # @param text [Regexp, String] a value to match
49
49
  # @return `true` if the page has a matching message, `false` otherwise
50
50
  def has_alert_message?(text)
51
51
  has_message?(:alert, text)
@@ -53,13 +53,13 @@ module Mache
53
53
 
54
54
  # Tests whether the page has an error message.
55
55
  #
56
- # @param [Regexp, String] text a value to match
56
+ # @param text [Regexp, String] a value to match
57
57
  # @return `true` if the page has a matching message, `false` otherwise
58
58
  def has_error_message?(text)
59
59
  has_message?(:error, text)
60
60
  end
61
61
  end
62
- # rubocop:enable Style/PredicateName
62
+ # rubocop:enable Naming/PredicateName
63
63
  end
64
64
  end
65
65
  end
@@ -1,7 +1,7 @@
1
1
  module Mache
2
2
  module Helpers
3
3
  module Rails
4
- # The {Routes} module can be Included into page object classes that
4
+ # The {Routes} module can be included into page object classes that
5
5
  # support routing.
6
6
  module Routes
7
7
  def self.included(base)
@@ -1,2 +1,2 @@
1
- require "mache/helpers/rails/flash"
2
- require "mache/helpers/rails/routes"
1
+ require 'mache/helpers/rails/flash'
2
+ require 'mache/helpers/rails/routes'
data/lib/mache/node.rb CHANGED
@@ -1,8 +1,8 @@
1
- require "mache/dsl"
1
+ require 'mache/dsl'
2
2
 
3
3
  module Mache
4
4
  # The {Node} class represents a wrapped HTML page, or fragment. It exposes all
5
- # methods from the Mache {DSL}, and forwards any Capybara API methods to the
5
+ # methods from the Mache DSL, and forwards any Capybara API methods to the
6
6
  # {#node} object.
7
7
  #
8
8
  # @abstract
@@ -11,7 +11,7 @@ module Mache
11
11
 
12
12
  # The underlying Capybara node object wrapped by this instance.
13
13
  #
14
- # @return [Capybara::Node] the node object
14
+ # @return [Capybara::Node] a node object
15
15
  attr_reader :node
16
16
 
17
17
  # Returns a new instance of Node.
data/lib/mache/page.rb CHANGED
@@ -1,5 +1,5 @@
1
- require "capybara"
2
- require "mache/node"
1
+ require 'capybara'
2
+ require 'mache/node'
3
3
 
4
4
  module Mache
5
5
  # The {Page} class wraps an HTML page with an application-specific API. You
@@ -38,7 +38,7 @@ module Mache
38
38
 
39
39
  # Visits the page at its {#path}.
40
40
  #
41
- # @return [Page] the page object
41
+ # @return [Page] a page object
42
42
  def visit
43
43
  @node.visit(path)
44
44
  self
@@ -53,7 +53,7 @@ module Mache
53
53
 
54
54
  # Creates a new page object and calls {#visit} on it.
55
55
  #
56
- # @return [Page] the page object
56
+ # @return [Page] a page object
57
57
  def self.visit
58
58
  new.visit
59
59
  end
data/lib/mache/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mache
2
- VERSION = "2.1.1".freeze
2
+ VERSION = '3.0.0'.freeze
3
3
  end
data/lib/mache.rb CHANGED
@@ -1,3 +1,3 @@
1
- require "mache/node"
2
- require "mache/page"
3
- require "mache/version"
1
+ require 'mache/node'
2
+ require 'mache/page'
3
+ require 'mache/version'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mache
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Bassett
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-30 00:00:00.000000000 Z
11
+ date: 2018-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2'
19
+ version: '3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2'
26
+ version: '3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.14'
33
+ version: '1.16'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.14'
40
+ version: '1.16'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '12.0'
47
+ version: '12.3'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '12.0'
54
+ version: '12.3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rack
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -72,28 +72,28 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '3.5'
75
+ version: '3.7'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '3.5'
82
+ version: '3.7'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rubocop
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0.47'
89
+ version: '0.54'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0.47'
96
+ version: '0.54'
97
97
  description: Mâché provides helps you to write cleaner and more expressive acceptance
98
98
  tests for your web applications using page objects.
99
99
  email:
@@ -102,18 +102,9 @@ executables: []
102
102
  extensions: []
103
103
  extra_rdoc_files: []
104
104
  files:
105
- - ".gitignore"
106
- - ".rspec"
107
- - ".rubocop.yml"
108
- - ".ruby-version"
109
- - ".travis.yml"
110
- - ".yardopts"
111
105
  - CHANGELOG.md
112
- - Gemfile
113
- - LICENSE
106
+ - LICENSE.md
114
107
  - README.md
115
- - Rakefile
116
- - bin/console
117
108
  - lib/mache.rb
118
109
  - lib/mache/dsl.rb
119
110
  - lib/mache/helpers/rails.rb
@@ -122,7 +113,6 @@ files:
122
113
  - lib/mache/node.rb
123
114
  - lib/mache/page.rb
124
115
  - lib/mache/version.rb
125
- - mache.gemspec
126
116
  homepage: https://github.com/nullobject/mache
127
117
  licenses:
128
118
  - MIT
@@ -143,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
133
  version: '0'
144
134
  requirements: []
145
135
  rubyforge_project:
146
- rubygems_version: 2.6.11
136
+ rubygems_version: 2.6.13
147
137
  signing_key:
148
138
  specification_version: 4
149
139
  summary: A library for writing cleaner and more expressive acceptance tests using
data/.gitignore DELETED
@@ -1,4 +0,0 @@
1
- *.gem
2
- .bundle
3
- .yardoc
4
- Gemfile.lock
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --format documentation
2
- --color
data/.rubocop.yml DELETED
@@ -1,22 +0,0 @@
1
- AllCops:
2
- Exclude:
3
- - "mache.gemspec"
4
-
5
- Metrics/BlockLength:
6
- ExcludedMethods: describe
7
-
8
- Style/BlockDelimiters:
9
- Enabled: false
10
-
11
- Style/Documentation:
12
- Exclude:
13
- - "spec/**/*"
14
-
15
- Style/FrozenStringLiteralComment:
16
- Enabled: false
17
-
18
- Style/SpaceInsideHashLiteralBraces:
19
- Enabled: false
20
-
21
- Style/StringLiterals:
22
- EnforcedStyle: double_quotes
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 2.3.3
data/.travis.yml DELETED
@@ -1,2 +0,0 @@
1
- language: ruby
2
- before_install: gem install bundler -v 1.14.5
data/.yardopts DELETED
@@ -1 +0,0 @@
1
- --markup markdown
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- # Specify your gem's dependencies in mache.gemspec
4
- gemspec
data/Rakefile DELETED
@@ -1,8 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
- require "rubocop/rake_task"
4
-
5
- RSpec::Core::RakeTask.new(:spec)
6
- RuboCop::RakeTask.new
7
-
8
- task default: %w(spec rubocop)
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "mache"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start
data/mache.gemspec DELETED
@@ -1,27 +0,0 @@
1
- lib = File.expand_path("../lib", __FILE__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
-
4
- require "mache/version"
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "mache"
8
- spec.version = Mache::VERSION
9
- spec.authors = ["Joshua Bassett"]
10
- spec.email = ["josh.bassett@gmail.com"]
11
- spec.summary = "A library for writing cleaner and more expressive acceptance tests using page objects."
12
- spec.description = "Mâché provides helps you to write cleaner and more expressive acceptance tests for your web applications using page objects."
13
- spec.homepage = "https://github.com/nullobject/mache"
14
- spec.license = "MIT"
15
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
16
- f.match(%r{^(test|spec|features)/})
17
- end
18
- spec.require_paths = ["lib"]
19
-
20
- spec.add_dependency "capybara", "~> 2"
21
-
22
- spec.add_development_dependency "bundler", "~> 1.14"
23
- spec.add_development_dependency "rake", "~> 12.0"
24
- spec.add_development_dependency "rack", "~> 2.0"
25
- spec.add_development_dependency "rspec", "~> 3.5"
26
- spec.add_development_dependency "rubocop", "~> 0.47"
27
- end