https://www.puppet.com/community logo
Join Slack
Powered by
# voxpupuli
  • v

    VoxBot

    10/19/2023, 4:33 PM
    ewoud: > expected Puppet::Error with "found multiple config items of foo found, please fix this" but nothing was raised
  • v

    VoxBot

    10/19/2023, 4:33 PM
    :(
  • v

    VoxBot

    10/19/2023, 4:44 PM
    bastelfreak: still? :(
  • v

    VoxBot

    10/19/2023, 4:44 PM
    yeah
  • v

    VoxBot

    10/19/2023, 4:44 PM
    my rspec foo is not strong enough! :D
  • v

    VoxBot

    10/19/2023, 4:45 PM
    I'd make sure your allow() really affects anything
  • v

    VoxBot

    10/19/2023, 4:45 PM
    there's a good chance it silently calls something else and that returns [] or something
  • v

    VoxBot

    10/19/2023, 4:46 PM
    what about
  • v

    VoxBot

    10/19/2023, 4:46 PM
    either make it expect() or expect(provider).to have_received(:parse_config) IIRC
  • v

    VoxBot

    10/19/2023, 4:46 PM
    - allow(provider).to receive(:parse_config).and_return([{ key: 'foo', line: 1 }, { key: 'foo', line: 2 }])
  • v

    VoxBot

    10/19/2023, 4:46 PM
    + allow(provider.exists?).to receive(:parse_config).and_return([{ key: 'foo', line: 1 }, { key: 'foo', line: 2 }])
  • v

    VoxBot

    10/19/2023, 4:46 PM
    no, that won't work
  • v

    VoxBot

    10/19/2023, 4:46 PM
    mhm indeed
  • v

    VoxBot

    10/19/2023, 4:46 PM
    well it's a different error
  • v

    VoxBot

    10/19/2023, 4:46 PM
    :D
  • v

    VoxBot

    10/19/2023, 4:47 PM
    it would be equivalent to allow(false).to receive(:parse_config)
  • v

    VoxBot

    10/19/2023, 4:49 PM
    the fact that there are many different notations for rspec makes it really hard to google stuff
  • v

    VoxBot

    10/19/2023, 4:52 PM
    s/rspec/ruby/
  • v

    VoxBot

    10/19/2023, 4:52 PM
    quoting PEP8: There should be one-- and preferably only one --obvious way to do it.
  • d

    Dr Bunsen Honeydew

    10/19/2023, 4:52 PM
    one took a dive. (Karma: -1)
  • v

    VoxBot

    10/19/2023, 4:53 PM
    poo one
  • v

    VoxBot

    10/19/2023, 4:53 PM
    poor one
  • v

    VoxBot

    10/19/2023, 4:53 PM
    did we just define one as -1? mathematicians will love us
  • v

    VoxBot

    10/19/2023, 4:54 PM
    :D
  • v

    VoxBot

    10/19/2023, 4:55 PM
    "expect(provider).to have_received(:parse_config)" says it didn't receive anything
  • v

    VoxBot

    10/19/2023, 4:55 PM
    so "allow(provider).to receive(:parse_config).and_return([{ key: 'foo', line: 1 }, { key: 'foo', line: 2 }])" might be wrong
  • v

    VoxBot

    10/19/2023, 5:01 PM
    even if I move my allow() into the "before(:each) do" block, where the other allow() statements are, it fails
  • v

    VoxBot

    10/19/2023, 5:05 PM
    the whole before block seems useless :D
  • v

    VoxBot

    10/19/2023, 5:28 PM
    https://github.com/puppetlabs/puppetlabs-postgresql/pull/1540 alternative approach, but that also fails
  • v

    VoxBot

    10/19/2023, 5:38 PM
    bastelfreak: with the magic of puts I found your error: there's nothign wrong with your allow(provider) line, but the select {} on it returns []
1...582583584...648Latest