Sha256: ae9d5067b0676bfedb579a038cdf535bbe42499634dea694077711a68bd589c0

Contents?: true

Size: 525 Bytes

Versions: 9

Compression:

Stored size: 525 Bytes

Contents

beforeEach ->
  jasmine.addMatchers
    toHaveOpacity: (util, customEqualityTesters) ->
      compare: (element, expectedOpacity, tolerance = 0.0) ->
        element = up.util.element(element)
        actualOpacity = up.util.opacity(element)
        result = {}
        result.pass =  Math.abs(expectedOpacity - actualOpacity) <= tolerance
        unless result.pass
          result.message = up.browser.sprintf("Expected %o to have opacity %o, but it was %o", element, expectedOpacity, actualOpacity)
        return result

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
unpoly-rails-0.57.0 spec_app/spec/javascripts/helpers/to_have_opacity.coffee
unpoly-rails-0.56.7 spec_app/spec/javascripts/helpers/to_have_opacity.coffee
unpoly-rails-0.56.6 spec_app/spec/javascripts/helpers/to_have_opacity.coffee
unpoly-rails-0.56.5 spec_app/spec/javascripts/helpers/to_have_opacity.coffee
unpoly-rails-0.56.4 spec_app/spec/javascripts/helpers/to_have_opacity.coffee
unpoly-rails-0.56.3 spec_app/spec/javascripts/helpers/to_have_opacity.coffee
unpoly-rails-0.56.2 spec_app/spec/javascripts/helpers/to_have_opacity.coffee
unpoly-rails-0.56.1 spec_app/spec/javascripts/helpers/to_have_opacity.coffee
unpoly-rails-0.56.0 spec_app/spec/javascripts/helpers/to_have_opacity.coffee