Sha256: 96169421967d2798e92f24928fb69e737953098c7cb8526d0aab82b30b00b1cf

Contents?: true

Size: 743 Bytes

Versions: 6

Compression:

Stored size: 743 Bytes

Contents

require "spec_helper"

describe BrDanfe::DanfeLib::Options do
  it "returns the default config set in the code" do
    options = BrDanfe::DanfeLib::Options.new
    expect(options.logo_path).to eq("")
    expect(options.products_unit_price_precision).to eq(2)
    expect(options.products_quantity_precision).to eq(2)
  end

  it "returns the config set in params" do
    custom_options = { logo_path: "/fake/path/file.png",
      products_unit_price_precision: 3, products_quantity_precision: 4 }

    options = BrDanfe::DanfeLib::Options.new(custom_options)
    expect(options.logo_path).to eq("/fake/path/file.png")
    expect(options.products_unit_price_precision).to eq(3)
    expect(options.products_quantity_precision).to eq(4)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
br_danfe-0.5.0 spec/lib/danfe_lib/options_spec.rb
br_danfe-0.4.3 spec/lib/danfe_lib/options_spec.rb
br_danfe-0.4.2 spec/lib/danfe_lib/options_spec.rb
br_danfe-0.4.1 spec/lib/danfe_lib/options_spec.rb
br_danfe-0.4.0 spec/lib/danfe_lib/options_spec.rb
br_danfe-0.3.0 spec/lib/danfe_lib/options_spec.rb