[yast-devel] RSpec is green but... can you spot the problem?
I've made this mistake today: #!/usr/bin/rspec require "yaml" describe "WTF" do it "works" do filename = "/usr/share/YaST2/data/sndcards.yml" expect { YAML.load_file(filename).to_not raise_error } end end I caught it early because I also ran the test in failing mode (by making a deliberate syntax error in the YAML file). -- Martin Vidner, YaST Team http://en.opensuse.org/User:Mvidner Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 12.10.2015 12:36, Martin Vidner wrote:
I've made this mistake today:
#!/usr/bin/rspec require "yaml" describe "WTF" do it "works" do filename = "/usr/share/YaST2/data/sndcards.yml" expect { YAML.load_file(filename).to_not raise_error }
I thought expect chain is somehow required :) It seems it's not :)
end end
I caught it early because I also ran the test in failing mode (by making a deliberate syntax error in the YAML file).
- -- Lukas Ocilka, Systems Management (Yast) Team Leader SLE Department, SUSE Linux -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlYbkQAACgkQVSqMdRCqTiwgcACaA1qNW+4eQDWLWC1QSDNVfRCi wRYAn2Ck7j85OETQNThLddewgA1OFPyO =UgV3 -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On Mon, Oct 12, 2015 at 12:36:54PM +0200, Martin Vidner wrote: Maybe I can spot the error.
expect { YAML.load_file(filename).to_not raise_error }
expect { YAML.load_file(filename) }.to_not raise_error How much points do I get? ciao Arvin -- Arvin Schnell, <aschnell@suse.com> Senior Software Engineer, Research & Development SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) Maxfeldstraße 5 90409 Nürnberg Germany -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On Mon, Oct 12, 2015 at 01:56:13PM +0200, Arvin Schnell wrote:
On Mon, Oct 12, 2015 at 12:36:54PM +0200, Martin Vidner wrote:
Maybe I can spot the error.
expect { YAML.load_file(filename).to_not raise_error }
expect { YAML.load_file(filename) }.to_not raise_error
How much points do I get?
Correct, you get 863 points! And Lukas gets to watch what happens with a bug report that I filed about this: https://github.com/rspec/rspec-expectations/issues/863 I almost started to fix it but decided to hear the maintainers' opinion first. -- Martin Vidner, YaST Team http://en.opensuse.org/User:Mvidner Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu
participants (3)
-
Arvin Schnell
-
Lukas Ocilka
-
Martin Vidner