azebiki 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -50,11 +50,27 @@ module Azebiki
50
50
  class Checker
51
51
 
52
52
  class MyHaveSelector < Webrat::Matchers::HaveSelector
53
+ def tag_inspect
54
+ options = @options.dup
55
+ count = options.delete(:count)
56
+ content = options.delete(:content) unless @expected == "meta"
57
+
58
+ html = "<#{@expected}"
59
+ options.each do |k,v|
60
+ html << " #{k}='#{v}'"
61
+ end
62
+
63
+ html << ">#{content}</#{@expected}>"
64
+
65
+ html
66
+ end
67
+
53
68
  def add_attributes_conditions_to(query)
54
69
  attribute_conditions = []
55
70
 
56
71
  @options.each do |key, value|
57
- next if [:content, :count].include?(key)
72
+ next if key == :content unless @expected == "meta"
73
+ next if key == :count
58
74
  if value.is_a?(Hash)
59
75
  func, match = value.keys.first, value.values.first
60
76
  attribute_conditions << "#{func}(@#{key}, #{xpath_escape(match)})"
@@ -67,6 +83,12 @@ module Azebiki
67
83
  query << "[#{attribute_conditions.join(' and ')}]"
68
84
  end
69
85
  end
86
+
87
+ def add_content_condition_to(query)
88
+ if @options[:content] and @expected != "meta"
89
+ query << "[contains(., #{xpath_escape(@options[:content])})]"
90
+ end
91
+ end
70
92
 
71
93
  def matches?(stringlike, &block)
72
94
  @block ||= block
@@ -1,3 +1,3 @@
1
1
  module Azebiki
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 2
9
- version: 0.0.2
8
+ - 3
9
+ version: 0.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Eric Allam
@@ -14,12 +14,11 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-11-16 00:00:00 -05:00
17
+ date: 2011-03-07 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: webrat
22
- prerelease: false
23
22
  requirement: &id001 !ruby/object:Gem::Requirement
24
23
  none: false
25
24
  requirements:
@@ -29,6 +28,7 @@ dependencies:
29
28
  - 0
30
29
  version: "0"
31
30
  type: :runtime
31
+ prerelease: false
32
32
  version_requirements: *id001
33
33
  description: ""
34
34
  email:
@@ -61,6 +61,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
61
61
  requirements:
62
62
  - - ">="
63
63
  - !ruby/object:Gem::Version
64
+ hash: -3314863436418873415
64
65
  segments:
65
66
  - 0
66
67
  version: "0"