File: runner.rb

package info (click to toggle)
ruby-ramaze 2012.12.08-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 3,060 kB
  • ctags: 1,200
  • sloc: ruby: 10,446; makefile: 8
file content (30 lines) | stat: -rw-r--r-- 1,042 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
require File.expand_path('../../../../spec/helper', __FILE__)
require __DIR__('../../../lib/ramaze/bin/runner')

describe('Ramaze::Bin::Runner') do

  it('Executable should exist and should be readable') do
    File.exist?(Ramaze::BINPATH).should    === true
    File.readable?(Ramaze::BINPATH).should === true
  end

  it('Should show a help message') do
    help, help_1 = `#{Ramaze::BINPATH}`.strip, `#{Ramaze::BINPATH} -h`.strip

    help.should                                       === help_1
    help.include?(Ramaze::Bin::Runner::Banner).should === true
    help.include?('Options').should                   === true
    help.include?('Commands').should                  === true

    # Check if all the commands are displayed
    Ramaze::Bin::Runner::Commands.each do |name, klass|
      help.include?(name.to_s).should === true
    end
  end

  it('Should show the version number') do
    `#{Ramaze::BINPATH} -v`.strip.should        === Ramaze::VERSION
    `#{Ramaze::BINPATH} --version`.strip.should === Ramaze::VERSION
  end

end