File: asserts_with_arguments_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 (23 lines) | stat: -rw-r--r-- 721 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require 'teststrap'

context "an assertion made with arguments" do
  setup do
    Riot::Context.new("foo") {}.asserts(:[], 0)
  end

  should("pass its argument to send, with the first argument as method name") do
    (situation = Riot::Situation.new).instance_variable_set(:@_topic, [1, 2])
    topic.equals(1).run(situation).first
  end.equals(:pass)
end # assertion made with arguments

context "a should made with arguments" do
  setup do
    Riot::Context.new("foo") {}.should(:[], 0)
  end

  should("pass its argument to send, with the first argument as method name") do
    (situation = Riot::Situation.new).instance_variable_set(:@_topic, [1, 2])
    topic.equals(1).run(situation).first
  end.equals(:pass)
end