Class: ShouldPricot::CountAssertion
- Inherits:
-
Object
- Object
- ShouldPricot::CountAssertion
- Defined in:
- lib/should_pricot/count_assertion.rb
Instance Method Summary collapse
-
#initialize(selector, html, test_instance) ⇒ CountAssertion
constructor
A new instance of CountAssertion.
- #should_be(expected) ⇒ Object
Constructor Details
#initialize(selector, html, test_instance) ⇒ CountAssertion
Returns a new instance of CountAssertion.
3 4 5 6 |
# File 'lib/should_pricot/count_assertion.rb', line 3 def initialize(selector, html, test_instance) @test = test_instance @elements = (html/selector) end |
Instance Method Details
#should_be(expected) ⇒ Object
8 9 10 |
# File 'lib/should_pricot/count_assertion.rb', line 8 def should_be(expected) @test.assert_equal expected, @elements.size end |