Sha256: f5e6c14b02f8c4b91e827c052b6e62cac59d5658d2defc9626a5d32ae806166a
Contents?: true
Size: 591 Bytes
Versions: 9
Compression:
Stored size: 591 Bytes
Contents
require 'teststrap' context "An exists assertion macro" do setup { Riot::Situation.new } asserts(":pass when result has a value") do Riot::Assertion.new("foo") { "foo" }.exists.run(topic) end.equals([:pass, "is not nil"]) asserts(":pass because empty string is considered a value") do Riot::Assertion.new("foo") { "" }.exists.run(topic) end.equals([:pass, "is not nil"]) asserts(":fail with message when value is nil") do Riot::Assertion.new("foo") { nil }.exists.run(topic)[0..1] end.equals([:fail, "expected a non-nil value"]) end # An exists assertion macro
Version data entries
9 entries across 9 versions & 1 rubygems