Sha256: f465369b74cbb5997739987d978e71a423610b8f0babfe6a30cefdb21c5df6d6

Contents?: true

Size: 866 Bytes

Versions: 2

Compression:

Stored size: 866 Bytes

Contents

beforeEach ->
  @addMatchers toBeEmpty: ->
    @message = -> "Expected #{_(@actual).value().constructor.name} to be empty"
    _(@actual).isEmpty()
  
  @addMatchers toBeA: (expected) ->
    value = _(@actual).value()
    @message = -> "Expected #{value.constructor.name} to be a #{expected.name}"
    switch expected  # handle inconsistent instanceof interface
      when String then value.constructor.name == "String"
      when Number then value.constructor.name == "Number"
      else value instanceof expected
  
  @addMatchers toBeValid: () ->
    @message = -> "Expected #{_(@actual).value().constructor.name} to be valid"
    @actual.isValid()
  
  # Non-recursive version of toContain()
  @addMatchers toInclude: (expected) ->
    @message = -> "Expected the collection to include #{_(@actual).value().constructor.name}"
    _(@actual).include(expected)
  

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rails-backbone-generator-0.1.9 lib/generators/backbone_generator/setup_generator/templates/spec/javascripts/helpers/common_helpers.coffee
rails-backbone-generator-0.1.8 lib/generators/backbone_generator/setup_generator/templates/spec/javascripts/helpers/common_helpers.coffee