aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimm <kaspth@gmail.com>2013-08-16 19:47:53 +0200
committerTimm <kaspth@gmail.com>2014-06-16 21:04:08 +0200
commit20615ec7e6658be53e713545967f8c054303ec3c (patch)
tree2a4548761ab20ea8a5cb759afde82ebfcb5e0323
parent71aaddbd1464c4ad02bea9bbaada622da0b1feb1 (diff)
downloadrails-20615ec7e6658be53e713545967f8c054303ec3c.tar.gz
rails-20615ec7e6658be53e713545967f8c054303ec3c.tar.bz2
rails-20615ec7e6658be53e713545967f8c054303ec3c.zip
Changed: HTMLSelector comparisons renamed to equality_tests.
-rw-r--r--actionview/lib/action_view/testing/assertions/selector.rb15
1 files changed, 6 insertions, 9 deletions
diff --git a/actionview/lib/action_view/testing/assertions/selector.rb b/actionview/lib/action_view/testing/assertions/selector.rb
index e3aa6bf0f1..dda45b5730 100644
--- a/actionview/lib/action_view/testing/assertions/selector.rb
+++ b/actionview/lib/action_view/testing/assertions/selector.rb
@@ -155,7 +155,7 @@ module ActionView
selector = HTMLSelector.new(@selected, response_from_page, args)
matches = selector.select
- assert_size_match!(matches.size, selector.comparisons, selector.source, selector.message)
+ assert_size_match!(matches.size, selector.equality_tests, selector.source, selector.message)
# Set @selected to allow nested assert_select.
# Can be nested several levels deep.
@@ -305,7 +305,7 @@ module ActionView
end
class HTMLSelector #:nodoc:
- attr_accessor :root, :css_selector, :comparisons, :message
+ attr_accessor :root, :css_selector, :equality_tests, :message
alias :source :css_selector
@@ -317,10 +317,7 @@ module ActionView
selector = @css_selector_is_second_argument ? args.shift(2).last : args.shift
@css_selector = selector_from(selector, args)
- # Next argument is used for equality tests.
- @comparisons = comparisons_from(args.shift)
-
- # Last argument is the message we use if the assertion fails.
+ @equality_tests = equality_tests_from(args.shift)
@message = args.shift
if args.shift
@@ -333,11 +330,11 @@ module ActionView
end
def filter(matches)
- match_with = comparisons[:text] || comparisons[:html]
+ match_with = equality_tests[:text] || equality_tests[:html]
return matches if matches.empty? || !match_with
content_mismatch = nil
- text_matches = comparisons.has_key?(:text)
+ text_matches = equality_tests.has_key?(:text)
remaining = matches.reject do |match|
# Preserve markup with to_s for html elements
@@ -387,7 +384,7 @@ module ActionView
context.substitute!(selector, substitution_values)
end
- def comparisons_from(comparator)
+ def equality_tests_from(comparator)
comparisons = {}
case comparator
when Hash