Sha256: 5b4ee4b6b9e7f9a015dbbaa3947a37897aa6d60be06cc194e2c8830a73029cb5

Contents?: true

Size: 607 Bytes

Versions: 16

Compression:

Stored size: 607 Bytes

Contents

# frozen_string_literal: true

require 'ehbrs/cooking_book/recipe/measure'

RSpec.describe ::Ehbrs::CookingBook::Recipe::Measure do
  describe '#build'
  {
    '1.5 cup' => [1.5, nil, 'cup'],
    '~' => [nil, nil, nil],
    '2/ 3 u' => [2, 3, 'u'],
    '4.5/7.8' => [4.5, 7.8, nil]
  }.each do |source, expected|
    context "when source is \"#{source}\"" do
      let(:instance) { described_class.build(source) }

      it { expect(instance.numerator).to eq(expected[0]) }
      it { expect(instance.denominator).to eq(expected[1]) }
      it { expect(instance.unit).to eq(expected[2]) }
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ehbrs-tools-0.35.1 spec/lib/ehbrs/cooking_book/recipe/measure_spec.rb
ehbrs-tools-0.35.0 spec/lib/ehbrs/cooking_book/recipe/measure_spec.rb
ehbrs-tools-0.34.0 spec/lib/ehbrs/cooking_book/recipe/measure_spec.rb
ehbrs-tools-0.33.0 spec/lib/ehbrs/cooking_book/recipe/measure_spec.rb
ehbrs-tools-0.32.0 spec/lib/ehbrs/cooking_book/recipe/measure_spec.rb
ehbrs-tools-0.31.1 spec/lib/ehbrs/cooking_book/recipe/measure_spec.rb
ehbrs-tools-0.31.0 spec/lib/ehbrs/cooking_book/recipe/measure_spec.rb
ehbrs-tools-0.30.0 spec/lib/ehbrs/cooking_book/recipe/measure_spec.rb
ehbrs-tools-0.29.0 spec/lib/ehbrs/cooking_book/recipe/measure_spec.rb
ehbrs-tools-0.28.3 spec/lib/ehbrs/cooking_book/recipe/measure_spec.rb
ehbrs-tools-0.28.2 spec/lib/ehbrs/cooking_book/recipe/measure_spec.rb
ehbrs-tools-0.28.1 spec/lib/ehbrs/cooking_book/recipe/measure_spec.rb
ehbrs-tools-0.28.0 spec/lib/ehbrs/cooking_book/recipe/measure_spec.rb
ehbrs-tools-0.27.0 spec/lib/ehbrs/cooking_book/recipe/measure_spec.rb
ehbrs-tools-0.26.0 spec/lib/ehbrs/cooking_book/recipe/measure_spec.rb
ehbrs-tools-0.25.1 spec/lib/ehbrs/cooking_book/recipe/measure_spec.rb