cubesystems/releaf

View on GitHub
lib/releaf/rspec/matchers/have_number_of_resources.rb

Summary

Maintainability
A
0 mins
Test Coverage
RSpec::Matchers.define :have_number_of_resources do |number_of_resources|

  match do |subject|
    @text = "#{number_of_resources} resources found"
    @node = find "main > section header .totals"
    @node.has_text? @text, exact: true
  end

  failure_message do |subject|
    "expected #{@node.text.inspect} to match #{@text.inspect}"
  end

end