minitest-capybara 0.8.2 → 0.9.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
- SHA1:
3
- metadata.gz: 990ef26c60cacebe8dc96e6f57dba1085f57d9c6
4
- data.tar.gz: 94b17eeba7c455a07a919635562baedd6f68c6ab
2
+ SHA256:
3
+ metadata.gz: bd09857f67fa50ed5c9049e58bf3fbc13b287e774ddbb56b042455c23d36bad3
4
+ data.tar.gz: e041b39eecec3d20f8e07a6dd035f0284a1c6bc1b375b883d4d16bacc4cf33f8
5
5
  SHA512:
6
- metadata.gz: f5ca70f65877118120e98ae1efd48addae12d68e062b0b3faafe5ea43d47fe68331dde9a29985d39b925cf3b79f8b3f524c9c513741f5dbc314b7d7ea001e2ef
7
- data.tar.gz: b1db56af48fbdd5e4cb8b9bf574dc169fbc9f90c0e1058a46669dcc6eaf6c33ba958f3c922d6245330094cb25916dd44416d9404dcfff81425c651c1929c473c
6
+ metadata.gz: b6a96fe8943303c87f2f2c9921947ce68d499f3df9bf407230eef899b7dd37a97dd1340e518dd79860b500b8bf73baac34d2b977305f367f7d42c400d875b667
7
+ data.tar.gz: 702d5de2541dabfc0aca4a9936424e1d196ae935fff79e396fd40613a961b2f7da3fdd3c7e98e1cafe1f0d4047dff100f2f95038fb3bb1be44704923b241ad68
@@ -1,9 +1,10 @@
1
1
  language: ruby
2
2
  cache: bundler
3
3
  rvm:
4
- - 2.1
5
- - 2.2
6
- - 2.3.0
4
+ - 2.1.8
5
+ - 2.2.6
6
+ - 2.3.3
7
+ - 2.4.0
7
8
 
8
9
  sudo: false
9
10
  script: RUBYOPT="-w $RUBYOPT" bundle exec rake
@@ -1,5 +1,10 @@
1
1
  ## HEAD
2
2
 
3
+ ## v0.9.0
4
+
5
+ * Loosen hard capybara dependency
6
+ * Fix missing failure text in Capybara 2.9+
7
+
3
8
  ## v0.8.2
4
9
 
5
10
  * Explicitly require capybara/dsl
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.8.2
1
+ 0.9.0
@@ -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.failure_message(*args) }
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
@@ -1,5 +1,6 @@
1
1
  require "capybara"
2
2
  require "capybara/dsl"
3
+ require "minitest/capybara/helpers"
3
4
  require "minitest/capybara/version"
4
5
 
5
6
  module Minitest
@@ -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
@@ -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", "~> 2.2"
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.8.2
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: 2016-02-06 00:00:00.000000000 Z
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: '2.2'
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: '2.2'
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.5.1
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: []