subject subject =~ /^#{@text}.*/ end def failure_message_for_should "expected to start with #{@text}" end def failure_message_for_should_not "expected not to start with #{@text}" end end MiniTest::Unit::TestCase.register_matcher MyMatcher, :start_with describe 'something' do it 'must start with...' do page = 'my reply' page.must_start_with 'my reply' end end minitest-matchers
do click_button 'ߘ͢Δ' page.text.must_include 'ߘ͠·ͨ͠' end it '"আ͢Δ"ϘλϯΛԡͨ͠Β confirm ͕දࣔ͞Ε͍ͯΔ͜ͱ', js: true do click_button 'আ͢Δ' page.driver.confirm_messages.wont_be_empty end end minitest-metadata