Class Merb::Test::Rspec::ControllerMatchers::Provide
In: merb-core/lib/merb-core/test/matchers/controller_matchers.rb
Parent: Object

Methods

Public Class methods

Parameters

expected<Symbol>:A format to check

[Source]

    # File merb-core/lib/merb-core/test/matchers/controller_matchers.rb, line 63
63:     def initialize(expected)
64:       @expected = expected
65:     end

Public Instance methods

Returns

String:The failure message.

[Source]

    # File merb-core/lib/merb-core/test/matchers/controller_matchers.rb, line 80
80:     def failure_message
81:       "expected #{@target.name} to provide #{@expected}, but it doesn't"
82:     end

Parameters

target<Symbol>:A ControllerClass or controller_instance

Returns

Boolean:True if the formats provided by the target controller/class include the expected

[Source]

    # File merb-core/lib/merb-core/test/matchers/controller_matchers.rb, line 73
73:     def matches?(target)
74:       @target = target
75:       provided_formats.include?( @expected )
76:     end

Returns

String:The failure message to be displayed in negative matches.

[Source]

    # File merb-core/lib/merb-core/test/matchers/controller_matchers.rb, line 86
86:     def negative_failure_message
87:       "expected #{@target.name} not to provide #{@expected}, but it does"
88:     end

Returns

Array[Symbol]:The formats the expected provides

[Source]

    # File merb-core/lib/merb-core/test/matchers/controller_matchers.rb, line 92
92:     def provided_formats
93:       @target.class_provided_formats
94:     end

[Validate]