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

Version Path
riot-0.11.4 test/core/assertion_macros/exists_test.rb
riot-0.11.4.pre test/core/assertion_macros/exists_test.rb
riot-0.11.3 test/core/assertion_macros/exists_test.rb
riot-0.11.2 test/core/assertion_macros/exists_test.rb
riot-0.11.1 test/core/assertion_macros/exists_test.rb
riot-0.11.0 test/core/assertion_macros/exists_test.rb
riot-0.10.13 test/core/assertion_macros/exists_test.rb
riot-0.10.13.pre test/core/assertion_macros/exists_test.rb
riot-0.10.12 test/core/assertion_macros/exists_test.rb