Sha256: 9fe059ac2c9280da85bb9a1e7c550e2c46f57f2e3f8301d7b94a5700bd972143
Contents?: true
Size: 740 Bytes
Versions: 7
Compression:
Stored size: 740 Bytes
Contents
require 'nokogiri' module Ruhl module Rspec module Sinatra def self.included(parent) ruby = <<-RUBY before do f = File.basename("#{caller[0].split(':').first}") f = "#{app.views}/" + f.sub('_spec.rb','') @view_nodes = Nokogiri::HTML.fragment(File.read(f)) end def ruhl_view @view_nodes end def data_ruhl(path) tag = ruhl_view.css(path).first unless tag raise Spec::Matchers::MatcherError.new("CSS selector: "+ path + " not found") end tag.attribute('data-ruhl').to_s end RUBY parent.class_eval ruby end end end end
Version data entries
7 entries across 7 versions & 1 rubygems