Sha256: ce7ca50083f5234fed3b356b43cae4d409a743d9611a13d134c6aeee4c7e9b83
Contents?: true
Size: 1.11 KB
Versions: 16
Compression:
Stored size: 1.11 KB
Contents
module Pancake module Test module Matchers class MountMatcher def initialize(expected_app, path) @expected_app, @path = expected_app, path end def matches?(target) @target = target @ma = @target::Router.mounted_applications.detect{|m| m.mounted_app == @expected_app} if @ma @ma.mounted_app == @expected_app && @ma.mount_path == @path else false end end def failure_message_for_should if @ma "Expected #{@target} to mount #{@expected_app} at #{@path.inspect} but was mounted at #{@ma.mount_path.inspect}" else "Expected #{@target} to mount #{@expected_app} but it was not mounted" end end def failure_message_for_should_not if @ma "Expected #{@target} to not implement #{@expected_app} at #{@path} but it was mounted there" end end end # MountMatcher def mount(expected, path) MountMatcher.new(expected, path) end end # Matchers end # Test end # Pancake
Version data entries
16 entries across 16 versions & 1 rubygems