Sha256: 39a48bf8d524c78ad8f8cdd2a2873f2ad6418f70b2735202b775a7a65c848c4b
Contents?: true
Size: 789 Bytes
Versions: 26
Compression:
Stored size: 789 Bytes
Contents
Feature: define wrapped matcher In order to reuse existing matchers As an RSpec user I want to define matchers that wrap other matchers Scenario: one additional method Given a file named "new_model_spec.rb" with: """ Spec::Matchers.define :have_tag do |tag| match do |markup| markup =~ /<#{tag}>.*<\/#{tag}>/ end end Spec::Matchers.define :have_button do match do |markup| markup.should have_tag('button') end end describe "some markup" do it "has a button" do "<button>Label</button>".should have_button end end """ When I run "spec new_model_spec.rb --format specdoc" Then the stdout should include "1 example, 0 failures"
Version data entries
26 entries across 26 versions & 9 rubygems