module ModelSpecHelper class MyMatcher def initialize(value) @value = value end def matches?(something) @something = something # The error here is intentional to demostrate the issue! @something == value end def failure_message "expected #{@something.inspect} be equal to #{@value.inspect} using mymatcher" end def description "be equal with mymatcher" end end def mymatch(value) MyMatcher.new(value) end end Spec::Runner.configure do |config| config.include ModelSpecHelper end describe "An auto-generated description for a example" do # generate a work name for the example if the matcher fails # or have faulty code. # # output: 'An auto-generated description for a example NAME NOT GENERATED' # # should be: 'An auto-generated description for a example should be equal with mymatcher' # even with the matcher NameError shown above. it { 1.should mymatch('2') } end