Skip to content

Preparing for RSpec4: Running specs fail with shared_context_metadata_behavior = :apply_to_host_groups #1136

@tagliala

Description

@tagliala

For tracking purposes

rspec ./spec/money_spec.rb:355 # Money#fractional with infinite_precision stores in fractional unit as an integer regardless of what is passed into the constructor
rspec ./spec/money_spec.rb:305 # Money#fractional loading a serialized Money via YAML is a BigDecimal when using infinite_precision
rspec ./spec/money_spec.rb:113 # Money.new with infinite_precision given the initializing value is 1.50 should have the correct cents
rspec ./spec/money_spec.rb:430 # Money#round_to_nearest_cash_value returns a BigDecimal when infinite_precision is set
rspec ./spec/money_spec.rb:866 # Money#round with infinite_precision when using a specific rounding precision uses the provided rounding precision
rspec ./spec/money_spec.rb:192 # Money.from_amount does not round the given amount when infinite_precision is set
rspec ./spec/money_spec.rb:567 # Money#to_s with infinite_precision shows fractional cents
rspec ./spec/money_spec.rb:575 # Money#to_s with infinite_precision shows fractional if needed when :subunut_to_unit == 1
rspec ./spec/money/formatting_spec.rb:633 # Money formatting #format :rounded_infinite_precision option does not round fractional when set to false
rspec ./spec/money/formatting_spec.rb:623 # Money formatting #format :rounded_infinite_precision option does round fractional when set to true
rspec ./spec/money/formatting_spec.rb:654 # Money formatting #format :rounded_infinite_precision option with i18n = false does round fractional when set to true
rspec ./spec/money/formatting_spec.rb:681 # Money formatting #format :rounded_infinite_precision option with i18n = true does round fractional when set to true
rspec ./spec/money/formatting_spec.rb:174 # Money formatting #format when :subunit_to_unit is 1 displays a decimal part when infinite_precision is true
  # This option will default to `:apply_to_host_groups` in RSpec 4 (and will
  # have no way to turn it off -- the option exists only for backwards
  # compatibility in RSpec 3). It causes shared context metadata to be
  # inherited by the metadata hash of host groups and examples, rather than
  # triggering implicit auto-inclusion in groups with matching metadata.
  config.shared_context_metadata_behavior = :apply_to_host_groups

The minimal reproduction command is:
rspec ./spec/money/formatting_spec.rb[1:5:5:3,1:5:28:1,1:5:28:2,1:5:28:3:1,1:5:28:4:1] ./spec/money_spec.rb[1:2:10:1:1,1:5:5,1:8:3:2,1:8:5:2,1:9:4,1:17:8:1,1:17:8:3,1:26:2:5:1]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions