File: assertion_macro_test.rb

package info (click to toggle)
ruby-riot 0.12.7-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 512 kB
  • sloc: ruby: 2,557; makefile: 2
file content (46 lines) | stat: -rw-r--r-- 1,206 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
require 'teststrap'

context "An AssertionMacro instance" do
  setup { Riot::AssertionMacro.new }

  asserts_topic.responds_to(:new_message)
  asserts_topic.responds_to(:expected_message)
  asserts_topic.responds_to(:should_have_message)
  asserts_topic.responds_to(:line)
  asserts_topic.responds_to(:line=)
  asserts_topic.responds_to(:file)
  asserts_topic.responds_to(:file=)

  #context "receiving #new_message" do
  #  setup { topic.new_message("hope") }

  #  asserts_topic.kind_of(Riot::Message)
  #  asserts(:to_s).equals(%q["hope"])
  #end

  #context "receiving #should_have_message" do
  #  setup { topic.should_have_message("hope") }

  #  asserts_topic.kind_of(Riot::Message)
  #  asserts(:to_s).equals(%q[should have "hope"])
  #end

  #context "receiving #expected_message" do
  #  setup { topic.expected_message("hope") }

  #  asserts_topic.kind_of(Riot::Message)
  #  asserts(:to_s).equals(%q[expected "hope"])
  #end
end # An AssertionMacro instance

context "AssertionMacro#fail" do
  setup do
    macro = Riot::AssertionMacro.new
    macro.line = 5
    macro.file = "foo"
    macro.fail("")
  end

  asserts_topic.includes(5)
  asserts_topic.includes("foo")
end # AssertionMacro#fail