minitest-capybara 0.8.2 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.travis.yml +4 -3
- data/CHANGELOG.md +5 -0
- data/Gemfile +7 -0
- data/VERSION +1 -1
- data/lib/capybara/assertions.rb +2 -2
- data/lib/minitest/capybara.rb +1 -0
- data/lib/minitest/capybara/helpers.rb +35 -0
- data/minitest-capybara.gemspec +1 -1
- data/test/minitest/capybara_test.rb +4 -2
- metadata +9 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bd09857f67fa50ed5c9049e58bf3fbc13b287e774ddbb56b042455c23d36bad3
|
4
|
+
data.tar.gz: e041b39eecec3d20f8e07a6dd035f0284a1c6bc1b375b883d4d16bacc4cf33f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6a96fe8943303c87f2f2c9921947ce68d499f3df9bf407230eef899b7dd37a97dd1340e518dd79860b500b8bf73baac34d2b977305f367f7d42c400d875b667
|
7
|
+
data.tar.gz: 702d5de2541dabfc0aca4a9936424e1d196ae935fff79e396fd40613a961b2f7da3fdd3c7e98e1cafe1f0d4047dff100f2f95038fb3bb1be44704923b241ad68
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -2,3 +2,10 @@ source "https://rubygems.org"
|
|
2
2
|
|
3
3
|
# Specify your gem's dependencies in minitest-matchers-capybara.gemspec
|
4
4
|
gemspec
|
5
|
+
|
6
|
+
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.2.2")
|
7
|
+
gem "rack", "< 2.0"
|
8
|
+
end
|
9
|
+
|
10
|
+
# DO NOT RELEASE WITH THIS LINE STILL HERE.
|
11
|
+
gem "capybara", "~> 2.8.0"
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.9.0
|
data/lib/capybara/assertions.rb
CHANGED
@@ -38,7 +38,7 @@ module Capybara
|
|
38
38
|
ruby << <<-RUBY
|
39
39
|
def assert_#{assertion}(*args)
|
40
40
|
node, *args = prepare_args(args)
|
41
|
-
assert node.has_#{assertion}?(*args), message { Capybara::Helpers.failure_message(*args) }
|
41
|
+
assert node.has_#{assertion}?(*args), message { Minitest::Capybara::Helpers.failure_message(*args) }
|
42
42
|
end
|
43
43
|
RUBY
|
44
44
|
end
|
@@ -46,7 +46,7 @@ module Capybara
|
|
46
46
|
ruby << <<-RUBY
|
47
47
|
def refute_#{refutation}(*args)
|
48
48
|
node, *args = prepare_args(args)
|
49
|
-
assert node.has_no_#{refutation}?(*args), message { Capybara::Helpers.
|
49
|
+
assert node.has_no_#{refutation}?(*args), message { Minitest::Capybara::Helpers.negative_failure_message(*args) }
|
50
50
|
end
|
51
51
|
alias_method :assert_no_#{refutation}, :refute_#{refutation}
|
52
52
|
RUBY
|
data/lib/minitest/capybara.rb
CHANGED
@@ -0,0 +1,35 @@
|
|
1
|
+
module Minitest
|
2
|
+
module Capybara
|
3
|
+
module Helpers
|
4
|
+
def self.failure_message(description, options={})
|
5
|
+
"expected to find #{description}" + count_message(options)
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.negative_failure_message(description, options={})
|
9
|
+
"expected not to find #{description}" + count_message(options)
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.declension(singular, plural, count)
|
13
|
+
if count == 1
|
14
|
+
singular
|
15
|
+
else
|
16
|
+
plural
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.count_message(options)
|
21
|
+
if options[:count]
|
22
|
+
" #{options[:count]} #{declension('time', 'times', options[:count])}"
|
23
|
+
elsif options[:between]
|
24
|
+
" between #{options[:between].first} and #{options[:between].last} times"
|
25
|
+
elsif options[:maximum]
|
26
|
+
" at most #{options[:maximum]} #{declension('time', 'times', options[:maximum])}"
|
27
|
+
elsif options[:minimum]
|
28
|
+
" at least #{options[:minimum]} #{declension('time', 'times', options[:minimum])}"
|
29
|
+
else
|
30
|
+
""
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/minitest-capybara.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
19
|
s.require_paths = ["lib"]
|
20
20
|
|
21
|
-
s.add_dependency "capybara"
|
21
|
+
s.add_dependency "capybara"
|
22
22
|
|
23
23
|
s.add_runtime_dependency "rake"
|
24
24
|
s.add_runtime_dependency "minitest", "~> 5.0"
|
@@ -35,12 +35,14 @@ class AppTest < Minitest::Capybara::Spec
|
|
35
35
|
|
36
36
|
it "supports assert_link" do
|
37
37
|
assert_link 'bar'
|
38
|
-
proc { assert_link("BAD") }.must_raise Minitest::Assertion
|
38
|
+
e = proc { assert_link("BAD") }.must_raise Minitest::Assertion
|
39
|
+
e.message.must_equal "expected to find BAD."
|
39
40
|
end
|
40
41
|
|
41
42
|
it "supports refute_link" do
|
42
43
|
refute_link 'BAD'
|
43
|
-
proc { refute_link("bar") }.must_raise Minitest::Assertion
|
44
|
+
e = proc { refute_link("bar") }.must_raise Minitest::Assertion
|
45
|
+
e.message.must_equal "expected not to find bar."
|
44
46
|
end
|
45
47
|
|
46
48
|
# expectations
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-capybara
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wojciech Mach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
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: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -71,6 +71,7 @@ files:
|
|
71
71
|
- lib/capybara/expectations.rb
|
72
72
|
- lib/minitest-capybara.rb
|
73
73
|
- lib/minitest/capybara.rb
|
74
|
+
- lib/minitest/capybara/helpers.rb
|
74
75
|
- lib/minitest/capybara/version.rb
|
75
76
|
- minitest-capybara.gemspec
|
76
77
|
- test/capybara/assertions_test.rb
|
@@ -97,14 +98,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
98
|
version: '0'
|
98
99
|
requirements: []
|
99
100
|
rubyforge_project: minitest-capybara
|
100
|
-
rubygems_version: 2.
|
101
|
+
rubygems_version: 2.7.7
|
101
102
|
signing_key:
|
102
103
|
specification_version: 4
|
103
104
|
summary: Capybara matchers support for minitest unit and spec
|
104
|
-
test_files:
|
105
|
-
- test/capybara/assertions_test.rb
|
106
|
-
- test/capybara/expectations_test.rb
|
107
|
-
- test/minitest/base_node_test.rb
|
108
|
-
- test/minitest/capybara_test.rb
|
109
|
-
- test/test_helper.rb
|
110
|
-
has_rdoc:
|
105
|
+
test_files: []
|