Sha256: e01194248aa91dcc765679502b4a05deea6b708d9839784c7678b89aa995cd28

Contents?: true

Size: 331 Bytes

Versions: 51

Compression:

Stored size: 331 Bytes

Contents

@function be-close-to($this, $precision) {
  $actual: actual();
  $when: false;

  @if type-of($actual) == "number" {
    $when: abs($this - $actual) < (bc-util-power(10, -$precision) / 2);
  } @else {
    $when: error("type", "The `be-close-to` matcher is only for numbers");
  }

  @return should("be close to", $this, $when);
}

Version data entries

51 entries across 51 versions & 2 rubygems

Version Path
oulu-rails-0.5.10 vendor/assets/stylesheets/bootcamp/dist/matchers/numbers/_be-close-to.scss
flint-gs-2.1.1 tests/bootcamp/dist/matchers/numbers/_be-close-to.scss
oulu-rails-0.5.9 vendor/assets/stylesheets/bootcamp/dist/matchers/numbers/_be-close-to.scss
oulu-rails-0.5.8 vendor/assets/stylesheets/bootcamp/dist/matchers/numbers/_be-close-to.scss
oulu-rails-0.5.7 vendor/assets/stylesheets/bootcamp/dist/matchers/numbers/_be-close-to.scss
flint-gs-2.1.0 tests/bootcamp/dist/matchers/numbers/_be-close-to.scss
flint-gs-2.0.9 tests/bootcamp/matchers/numbers/_be-close-to.scss
flint-gs-2.0.8 tests/bootcamp/matchers/numbers/_be-close-to.scss
flint-gs-2.0.6 tests/bootcamp/matchers/numbers/_be-close-to.scss
flint-gs-2.0.5 tests/bootcamp/matchers/numbers/_be-close-to.scss
flint-gs-2.0.4 tests/bootcamp/matchers/numbers/_be-close-to.scss