Sha256: a4dba1adcc955c4c78f83e587f9b2e9c774bd30a5389cc59cdca7102a0a3cce1
Contents?: true
Size: 910 Bytes
Versions: 21
Compression:
Stored size: 910 Bytes
Contents
require 'hamlit' require 'unindent' module HamlitSpecHelper def parse_string(str) Hamlit::Parser.new.call(str) end def render_string(str, options = {}) eval Hamlit::Engine.new(options).call(str) end def assert_render(haml, html, options = {}) haml = haml.unindent html = html.unindent expect(render_string(haml, options)).to eq(html) end def assert_parse(haml, &block) haml = haml.unindent ast = block.call expect(parse_string(haml)).to eq(ast) end def assert_compile(before, after) result = described_class.new.call(before) expect(result).to eq(after) end end RSpec.configure do |config| config.include HamlitSpecHelper config.expect_with :rspec do |expectations| expectations.include_chain_clauses_in_custom_matcher_descriptions = true end config.mock_with :rspec do |mocks| mocks.verify_partial_doubles = true end end
Version data entries
21 entries across 21 versions & 1 rubygems