Sha256: 345dfb1a295dd8f973cc001686dd52768b869287a21b5c48035ef7029ffc7bd3

Contents?: true

Size: 549 Bytes

Versions: 5

Compression:

Stored size: 549 Bytes

Contents

require 'spec_helper'

describe "constant definition" do
  it "sets constants for each value choice" do
    expect(CashRegister::UNKNOWN).to    eq(0)
    expect(CashRegister::NOT_ACTIVE).to eq(10)
    expect(CashRegister::ACTIVE).to     eq(20)
    expect(CashRegister::HONEYWELL).to  eq("HON")
    expect(CashRegister::SHARP).to      eq("SHCAY")
  end

  it "sets constants for each namespaced attribute value choice" do
    expect(CashRegister::DrawerPositions::OPENED).to eq(0)
    expect(CashRegister::DrawerPositions::CLOSED).to eq(1)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
flexible_enum-0.4.2 spec/constant_definition_spec.rb
flexible_enum-0.4.1 spec/constant_definition_spec.rb
flexible_enum-0.4.0 spec/constant_definition_spec.rb
flexible_enum-0.3.0 spec/constant_definition_spec.rb
flexible_enum-0.2.2 spec/constant_definition_spec.rb