File: basic_tests.rb

package info (click to toggle)
ruby-formatador 0.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 96 kB
  • sloc: ruby: 299; makefile: 2
file content (28 lines) | stat: -rw-r--r-- 574 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
24
25
26
27
28
Shindo.tests("Formatador") do

  tests("#display_line(Formatador)").returns("    Formatador\n") do
    capture_stdout do
      Formatador.display_line('Formatador')
    end
  end

output = <<-OUTPUT
    one
    two
OUTPUT

  tests("#display_lines(['one', 'two']").returns(output) do
    capture_stdout do
      Formatador.display_lines(['one', 'two'])
    end
  end

  tests("#indent { display_line('Formatador') }").returns("      Formatador\n") do
    capture_stdout do
      Formatador.indent do
        Formatador.display_line('Formatador')
      end
    end
  end

end