Sha256: 40d0fd2cbb07ef0ee01a1a10791e98d493d4aa7da1d612a5c6b83236b04a2100

Contents?: true

Size: 1.05 KB

Versions: 9

Compression:

Stored size: 1.05 KB

Contents

require 'teststrap'

context "Reporting a context" do
  setup do
    a_context = Riot::Context.new("foobar") do
      asserts("passing") { true }
      asserts("failing") { false }
      asserts("erroring") { raise Exception }
    end
    a_context.run(MockReporter.new)
  end

  asserts("one passed test") { topic.passes == 1 }
  asserts("one failed test") { topic.failures == 1 }
  asserts("one errored test") { topic.errors == 1 }
end # Reporting a context

context "Defining a context with multiple setups" do
  setup do
    @a_context = Riot::Context.new("foobar") do
      setup { "foo" }
      setup { topic + "bar" }
      asserts("blah") { topic == "foobar" }
    end
    @a_context.run(MockReporter.new)
  end
  asserts("has setups") { @a_context.setups.size }.equals(2)
  asserts("all tests pass") { topic.passes == 1 }
end # Defining a context with multiple setups

context "Making a new context" do
  asserts("RootContext is used if nil parent is provided") do
    Riot::Context.new("hello", nil) {}.parent
  end.kind_of(Riot::RootContext)
end # Making a context

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
riot-0.12.7 test/core/context/context_test.rb
riot-0.12.6 test/core/context/context_test.rb
riot-0.12.5 test/core/context/context_test.rb
riot-0.12.4 test/core/context/context_test.rb
riot-0.12.3 test/core/context/context_test.rb
riot-0.12.2 test/core/context/context_test.rb
riot-0.12.1 test/core/context/context_test.rb
riot-0.12.0 test/core/context/context_test.rb
riot-0.12.0.pre test/core/context/context_test.rb