minitest-capybara 0.4.1 → 0.4.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: 224bf84ca515945bdb1fd9eadd906474e2815a3b
4
- data.tar.gz: ec8007eac4550b3b9ccb83a534e81da937c2fee5
3
+ metadata.gz: b497bbdd2e41d866bd3a968134c5a980802f970c
4
+ data.tar.gz: ec80f5e74483499ff06d581992be000e048f7077
5
5
  SHA512:
6
- metadata.gz: 2ff29c7aa41f43c6ba5789b4d16057841d49beb21308b9decbe8f0a92492edefd75a81141361d7229d21b1bcd65e7cece8121dba75fc6ae9d34a9dae5fcafb19
7
- data.tar.gz: b5b4ed501094797d961fdd433460cf2a0ee72a5d3e20ff3235a5c6ef063f5bae9c32f802397699334e9acbce4a7c6f5e6a8d85d1d048d19e5a2eab5a54bdf29a
6
+ metadata.gz: 30197d1dcb8e98f23ebc9d59ec51b9b1b88d5eb137370118b06400fc1ad4e92d7625e303c8935dcc2f0b1a033c9cb8da204edffef429b334e16b5457a246ddbb
7
+ data.tar.gz: a4629726f88a2f450a3dd98af5d7dbaeb518727a4133d53459c9f01beb83fca6cc32d43464be1a58c89d25578c1ed8a11bda805f56619a9e0decf5d7da6a1179
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
1
+ 0.4.2
@@ -6,13 +6,13 @@ module Capybara
6
6
 
7
7
  def assert_text(*args)
8
8
  node, *args = prepare_args(args)
9
- assert has_text?(*args), message { "Expected to include #{args.first.inspect}" }
9
+ assert node.has_text?(*args), message { "Expected to include #{args.first.inspect}" }
10
10
  end
11
11
  alias_method :assert_content, :assert_text
12
12
 
13
13
  def refute_text(*args)
14
14
  node, *args = prepare_args(args)
15
- assert has_no_text?(*args), message { "Expected not to include #{args.first.inspect}" }
15
+ assert node.has_no_text?(*args), message { "Expected not to include #{args.first.inspect}" }
16
16
  end
17
17
  alias_method :assert_no_text, :refute_text
18
18
  alias_method :refute_content, :refute_text
@@ -283,7 +283,8 @@ module Capybara
283
283
  private
284
284
 
285
285
  def prepare_args(args)
286
- if args.first.is_a?(Capybara::Session) || args.first.kind_of?(Capybara::Node::Base)
286
+ if args.first.is_a?(Capybara::Session) || args.first.kind_of?(Capybara::Node::Base) ||
287
+ args.first.is_a?(Capybara::Node::Simple)
287
288
  args
288
289
  else
289
290
  [page, *args]
@@ -246,3 +246,7 @@ end
246
246
  class Capybara::Node::Base
247
247
  include Capybara::Expectations unless ENV["MT_NO_EXPECTATIONS"]
248
248
  end
249
+
250
+ class Capybara::Node::Simple
251
+ include Capybara::Expectations unless ENV["MT_NO_EXPECTATIONS"]
252
+ end
@@ -0,0 +1,58 @@
1
+ require File.join(File.dirname(__FILE__), '..', 'test_helper')
2
+
3
+ describe Capybara do
4
+ describe '.string' do
5
+ include Capybara::DSL
6
+ include Capybara::Assertions
7
+
8
+ before do
9
+ @test_node= Capybara.string <<-STRING
10
+ Hi everybody
11
+
12
+ I am a simple e-mail and just want to be tested
13
+
14
+ Greetings
15
+
16
+ Your friendly tester
17
+ STRING
18
+ end
19
+
20
+ describe "assertions" do
21
+ it "can assert_content String" do
22
+ assert_content @test_node, "everybody"
23
+ end
24
+
25
+ it "can assert_content Regexp" do
26
+ assert_content @test_node, /simple e-mail/
27
+ assert_content @test_node, /just.*tested/
28
+ end
29
+
30
+ it "wont match Regexp in a String" do
31
+ proc { assert_content(@test_node, "just.*tested") }.must_raise Minitest::Assertion
32
+ end
33
+
34
+ it "can refute_content" do
35
+ refute_content @test_node, "Everybody"
36
+ end
37
+ end
38
+
39
+ describe "expectations" do
40
+ it "supports must_have_content" do
41
+ @test_node.must_have_content "everybody"
42
+ end
43
+
44
+ it "supports must_have_content with regexp" do
45
+ @test_node.must_have_content /simple e-mail/
46
+ @test_node.must_have_content /just.*tested/
47
+ end
48
+
49
+ it "wont have Regexp content in a String" do
50
+ proc { @test_node.must_have_content "just.*tested" }.must_raise Minitest::Assertion
51
+ end
52
+
53
+ it "supports wont_have_content" do
54
+ @test_node.wont_have_content "Everybody"
55
+ end
56
+ end
57
+ end
58
+ end
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-capybara
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wojciech Mach
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-20 00:00:00.000000000 Z
11
+ date: 2013-10-07 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
19
  version: '2.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
26
  version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: minitest
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '4.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '4.0'
55
55
  description: Capybara matchers support for minitest unit and spec
@@ -59,8 +59,8 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
- - .gitignore
63
- - .travis.yml
62
+ - ".gitignore"
63
+ - ".travis.yml"
64
64
  - Gemfile
65
65
  - LICENSE.txt
66
66
  - README.md
@@ -74,6 +74,7 @@ files:
74
74
  - minitest-capybara.gemspec
75
75
  - test/capybara/assertions_test.rb
76
76
  - test/capybara/expectations_test.rb
77
+ - test/minitest/base_node_test.rb
77
78
  - test/minitest/capybara_test.rb
78
79
  - test/test_helper.rb
79
80
  homepage: ''
@@ -85,22 +86,23 @@ require_paths:
85
86
  - lib
86
87
  required_ruby_version: !ruby/object:Gem::Requirement
87
88
  requirements:
88
- - - '>='
89
+ - - ">="
89
90
  - !ruby/object:Gem::Version
90
91
  version: '0'
91
92
  required_rubygems_version: !ruby/object:Gem::Requirement
92
93
  requirements:
93
- - - '>='
94
+ - - ">="
94
95
  - !ruby/object:Gem::Version
95
96
  version: '0'
96
97
  requirements: []
97
98
  rubyforge_project: minitest-capybara
98
- rubygems_version: 2.0.3
99
+ rubygems_version: 2.1.5
99
100
  signing_key:
100
101
  specification_version: 4
101
102
  summary: Capybara matchers support for minitest unit and spec
102
103
  test_files:
103
104
  - test/capybara/assertions_test.rb
104
105
  - test/capybara/expectations_test.rb
106
+ - test/minitest/base_node_test.rb
105
107
  - test/minitest/capybara_test.rb
106
108
  - test/test_helper.rb