Class: Spec::Matchers::SendJsTo
- Inherits:
-
Object
- Object
- Spec::Matchers::SendJsTo
- Defined in:
- lib/assert2/rjs.rb
Instance Attribute Summary collapse
-
#failure_message ⇒ Object
readonly
Returns the value of attribute failure_message.
-
#negative_failure_message ⇒ Object
readonly
Returns the value of attribute negative_failure_message.
Instance Method Summary collapse
-
#initialize(scope, command, *args, &block) ⇒ SendJsTo
constructor
A new instance of SendJsTo.
- #matches?(response, &block) ⇒ Boolean
Constructor Details
#initialize(scope, command, *args, &block) ⇒ SendJsTo
Returns a new instance of SendJsTo.
231 232 233 |
# File 'lib/assert2/rjs.rb', line 231 def initialize(scope, command, *args, &block) @scope, @command, @args, @block = scope, command, args, block end |
Instance Attribute Details
#failure_message ⇒ Object (readonly)
Returns the value of attribute failure_message.
243 244 245 |
# File 'lib/assert2/rjs.rb', line 243 def @failure_message end |
#negative_failure_message ⇒ Object (readonly)
Returns the value of attribute negative_failure_message.
243 244 245 |
# File 'lib/assert2/rjs.rb', line 243 def @negative_failure_message end |
Instance Method Details
#matches?(response, &block) ⇒ Boolean
235 236 237 238 239 240 241 |
# File 'lib/assert2/rjs.rb', line 235 def matches?(response, &block) @block = block if block sample, asserter = @scope.__interpret_rjs(response, @command, @args, &@block) @failure_message = asserter. or @negative_failure_message = "should not find #{sample.inspect} in\n#{asserter.js}" # TODO complaint system return @negative_failure_message end |