wist 0.0.11 → 0.1.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: 3162aed8a3a36b5b573e05df2fe44d005ca6f774
4
- data.tar.gz: 8f2aef2f8836366921319dda68f56c3eaf40f007
3
+ metadata.gz: 23d02d137eaac3aeba10a8e1bd5d20cc489d831c
4
+ data.tar.gz: 429cf88b833112dd1b72eed4a99882db0da8cfc8
5
5
  SHA512:
6
- metadata.gz: 9fee6d1d974c47eec0881ffc23472fd1053e1052b0a4ae5280676acdb7570028928ecd1ea93f329bbdc1ecde9e581103c6968449127b7a6943805ecd1dd9f781
7
- data.tar.gz: 747093992700efac2d1dbd4bb1406619d096f9719bfe126edfb6eabe162b54a7f0cd011902fa7ac5f81f85a6f7231f71040cc6bb93bf8764aeceae75fe33739d
6
+ metadata.gz: 3d09afc40a00e8bfb67665535a0f319c8faf288bee45176cf5a9712638428e5a7bf8684dc2e8fc047422c6ba62cc93361a3409caa0de08bc1136c3cbba1d03e1
7
+ data.tar.gz: b10041c36ade40d479bb428115f0a78efac7d096f88503fae74292ae8ba559986bbeabea8faf17ce86fd6206d05b1f403aa31d09845a603358ee1acd61294dc9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- wist (0.0.11)
4
+ wist (0.1.0)
5
5
  capybara
6
6
 
7
7
  GEM
data/lib/wist.rb CHANGED
@@ -132,4 +132,16 @@ module Wist
132
132
 
133
133
  raise "visit #{url} failed" unless status == 'success'
134
134
  end
135
+
136
+ def assert_text(text, el)
137
+ assert_equal(text, el.text)
138
+ end
139
+
140
+ def assert_text_include(text, el)
141
+ assert_equal(true, el.text.include?(text))
142
+ end
143
+
144
+ def parent(el)
145
+ el.first(:xpath, './/..')
146
+ end
135
147
  end
data/test/test0.html CHANGED
@@ -28,6 +28,11 @@
28
28
 
29
29
  <button id='finder_with_wait'>foo</button>
30
30
 
31
+ <div>
32
+ parent
33
+ <div id='test_parent'></div>
34
+ </div>
35
+
31
36
  <script src='jquery.js'></script>
32
37
  <script src='jquery.cookie.js'></script>
33
38
  <script src='test.js'></script>
@@ -130,4 +130,16 @@ class WistTest < CapybaraTestCase
130
130
  visit_with_retries("file://#{Dir.pwd}/test/test0.html")
131
131
  verify_test_page(0)
132
132
  end
133
+
134
+ def test_assert_text
135
+ assert_text('foo', find('#click_test'))
136
+ end
137
+
138
+ def test_assert_text_include
139
+ assert_text_include('fo', find('#click_test'))
140
+ end
141
+
142
+ def test_parent
143
+ assert_text('parent', parent(find('#test_parent')))
144
+ end
133
145
  end
data/wist.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = 'wist'
3
- gem.version = '0.0.11'
3
+ gem.version = '0.1.0'
4
4
  gem.summary = 'capybara helpers'
5
5
  gem.author = 'Lihan Li'
6
6
  gem.email = 'frankieteardrop@gmail.com'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lihan Li
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-15 00:00:00.000000000 Z
11
+ date: 2013-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara