Sha256: 115a47dda400762b9a9bdcb25660540430aa1aed6816235b43c91330a2e42cc2

Contents?: true

Size: 1.53 KB

Versions: 7

Compression:

Stored size: 1.53 KB

Contents

FancySpec describe: TrueClass with: {
  it: "is true for calling and: with non-nil value" with: 'and: when: {
    true and: true . is: true
    true and: 'bar . is: 'bar
  }

  it: "is false for calling and: with a nil value" with: 'and: when: {
    true and: nil . is: nil
  }

  it: "is true for calling && with non-nil value" with: '&& when: {
    (true && true) is: true
    (true && 'bar) is: 'bar
  }

  it: "is false for calling && with a nil value" with: '&& when: {
    (true && nil) is: nil
  }

  it: "is true for calling or: with both non-nil values" with: 'or: when: {
    true or: true . is: true
  }

  it: "is true for calling or: with any values" with: 'or: when: {
    true or: nil . is: true
    true or: true . is: true
    true or: 'foo . is: true
  }

  it: "is true for calling || with both non-nil values" with: '|| when: {
    (true || true) is: true
  }

  it: "is true for calling || with any values" with: '|| when: {
    (true || nil) is: true
    (true || true) is: true
    (true || 'foo) is: true
  }

  it: "calls the then-block" with: 'if_true:else: when: {
    true if_true: { 'then } else: { 'else } . is: 'then
  }

  it: "does not call the block" with: 'if_false: when: {
    true if_false: { 'false } . is: nil
  }

  it: "is not nil" with: 'nil? when: {
    true nil? is: false
  }

  it: "is not false" with: 'false? when: {
    true false? is: false
  }

  it: "is true" with: 'true? when: {
    true true? is: true
  }

  it: "does NOT call the block if true" with: 'if_nil: when: {
    true if_nil: { 'is_nil } . is: nil
  }
}

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fancy-0.10.0 tests/true_class.fy
fancy-0.9.0 tests/true_class.fy
fancy-0.8.0 tests/true_class.fy
fancy-0.7.0 tests/true_class.fy
fancy-0.6.0 tests/true_class.fy
fancy-0.5.0 tests/true_class.fy
fancy-0.4.0 tests/true_class.fy