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