domino 0.4.0 → 0.5.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: e43e2a3c57d275789d53690b47d655b8c00a1a8b
4
- data.tar.gz: 33c195eeed332b154c3170d73218050e7b14fa10
3
+ metadata.gz: 3b2fc62eeaf1ab1a2ff6246839d6d312ef845b38
4
+ data.tar.gz: 395182dd48dba139cde162499d33918274019e84
5
5
  SHA512:
6
- metadata.gz: 51e71979470739a788bfc99ade82b49fec57a9a180f7e250f08ab9c663d767b8f31ff7228f2965bfec4732a8cfa40eb85a5d22de7f9e7a2b12917f336d479cb8
7
- data.tar.gz: 88a129ced9ae19bd15126eeec11e17c91671e9c8398241962d99e7e909b03bd941a9bab589695c682d90c55d382c10d51e9109ac703bd10dfdcfc51b73274ac7
6
+ metadata.gz: 7aefa91bbd7757aec8b80dbe9466fd26b6c9fe676b82e6da9e48b20a38d43a1488246a95b3d5f5998a2d5a3a54f564efe2ac83f4db77d42effd35a19b25cf174
7
+ data.tar.gz: 766c1df5a282ac53e4e26fd6137fcd396c0fe1aab39be5e9dc434ed30dd2ecb848308290733e29d0b76f8b73cd933c1de9b93fd5cd2c3eda8c79280db1b75e55
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  Gem::Specification.new do |gem|
3
3
  gem.name = "domino"
4
- gem.version = "0.4.0"
4
+ gem.version = "0.5.0"
5
5
  gem.platform = Gem::Platform::RUBY
6
6
  gem.authors = ["Nick Gauthier"]
7
7
  gem.email = ["ngauthier@gmail.com"]
@@ -97,7 +97,7 @@ class Domino
97
97
  attributes << attribute
98
98
  callbacks[attribute] = callback
99
99
 
100
- selector ||= %{.#{attribute.to_s}}
100
+ selector ||= %{.#{attribute.to_s.gsub("_", "-")}}
101
101
 
102
102
  class_eval %{
103
103
  def #{attribute}
@@ -16,23 +16,27 @@ class TestApplication
16
16
  <div id='people'>
17
17
  <div class='person'>
18
18
  <h2 class='name'>Alice</h2>
19
+ <p class='last-name'>Cooper</p>
19
20
  <p class='bio'>Alice is fun</p>
20
21
  <p class='fav-color'>Blue</p>
21
22
  <p class='age'>23</p>
22
23
  </div>
23
24
  <div class='person'>
24
25
  <h2 class='name'>Bob</h2>
26
+ <p class='last-name'>Marley</p>
25
27
  <p class='bio'>Bob is smart</p>
26
28
  <p class='fav-color'>Red</p>
27
29
  <p class='age'>52</p>
28
30
  </div>
29
31
  <div class='person'>
30
32
  <h2 class='name'>Charlie</h2>
33
+ <p class='last-name'>Murphy</p>
31
34
  <p class='bio'>Charlie is wild</p>
32
35
  <p class='fav-color'>Red</p>
33
36
  </div>
34
37
  <div class='person'>
35
38
  <h2 class='name'>Donna</h2>
39
+ <p class='last-name'>Summer</p>
36
40
  <p class='bio'>Donna is quiet</p>
37
41
  </div>
38
42
  </div>
@@ -55,6 +59,7 @@ class DominoTest < MiniTest::Unit::TestCase
55
59
  class Person < Domino
56
60
  selector '#people .person'
57
61
  attribute :name
62
+ attribute :last_name
58
63
  attribute :biography, '.bio'
59
64
  attribute :favorite_color, '.fav-color'
60
65
  attribute :age do |text|
@@ -119,6 +124,10 @@ class DominoTest < MiniTest::Unit::TestCase
119
124
  assert_equal 'Alice', Dom::Person.find_by_biography('Alice is fun').name
120
125
  end
121
126
 
127
+ def test_default_selector
128
+ assert_equal 'Cooper', Dom::Person.find_by_name('Alice').last_name
129
+ end
130
+
122
131
  def test_find_by_attribute_regex
123
132
  assert_equal 'Charlie', Dom::Person.find_by_biography(/wild/).name
124
133
  end
@@ -128,7 +137,7 @@ class DominoTest < MiniTest::Unit::TestCase
128
137
  end
129
138
 
130
139
  def test_attributes
131
- assert_equal({name: 'Alice', biography: 'Alice is fun', favorite_color: 'Blue', age: 23}, Dom::Person.first.attributes)
140
+ assert_equal({name: 'Alice', last_name: 'Cooper', biography: 'Alice is fun', favorite_color: 'Blue', age: 23}, Dom::Person.first.attributes)
132
141
  end
133
142
 
134
143
  def test_callback
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: domino
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Gauthier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-16 00:00:00.000000000 Z
11
+ date: 2013-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -83,7 +83,6 @@ files:
83
83
  - Rakefile
84
84
  - domino.gemspec
85
85
  - lib/domino.rb
86
- - lib/domino/version.rb
87
86
  - test/domino_test.rb
88
87
  homepage: http://github.com/ngauthier/domino
89
88
  licenses:
@@ -105,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
104
  version: '0'
106
105
  requirements: []
107
106
  rubyforge_project:
108
- rubygems_version: 2.0.0
107
+ rubygems_version: 2.0.2
109
108
  signing_key:
110
109
  specification_version: 4
111
110
  summary: View abstraction for integration testing
@@ -1,3 +0,0 @@
1
- module Domino
2
- VERSION = "0.0.1"
3
- end