Sha256: 64bcc55d92e6182ef80a6fa4f4a710f44e749e1f61202d70947c6f7b6d037f8c

Contents?: true

Size: 514 Bytes

Versions: 4

Compression:

Stored size: 514 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Optimizer::Function::Predicate::Enumerable, '.sort_by_value' do
  subject { object.sort_by_value(value) }

  let(:object) { self.class.described_type }

  context 'when the value is true' do
    let(:value) { true }

    it { should eql(1) }
  end

  context 'when the value is false' do
    let(:value) { false }

    it { should eql(0) }
  end

  context 'when the value is an object' do
    let(:value) { Object.new }

    it { should equal(value) }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
veritas-optimizer-0.0.7 spec/unit/veritas/optimizer/function/predicate/enumerable/class_methods/sort_by_value_spec.rb
veritas-optimizer-0.0.6 spec/unit/veritas/optimizer/function/predicate/enumerable/class_methods/sort_by_value_spec.rb
veritas-optimizer-0.0.5 spec/unit/veritas/optimizer/function/predicate/enumerable/class_methods/sort_by_value_spec.rb
veritas-optimizer-0.0.4 spec/unit/veritas/optimizer/function/predicate/enumerable/class_methods/sort_by_value_spec.rb