Sha256: dfe88b610e66aca8c30c39bb514002474d66457b91852c4164883b79c34603ac

Contents?: true

Size: 1.34 KB

Versions: 3

Compression:

Stored size: 1.34 KB

Contents

require_relative 'integration_spec_helper'

include GivenFilesystemSpecHelpers

def trollolo_cmd
  File.expand_path('../wrapper/trollolo_wrapper',__FILE__)
end

def trollolo_cmd_empty_config
  File.expand_path('../wrapper/empty_config_trollolo_wrapper',__FILE__)
end

def credentials_input_wrapper
  File.expand_path('../wrapper/credentials_input_wrapper',__FILE__)
end

describe "command line" do

  it "processes help option" do
    run "trollolo -h"
    assert_exit_status_and_partial_output 0, "Commands:"
    assert_partial_output "trollolo help", all_output
    assert_partial_output "Options:", all_output
  end

  it "throws error on invalid command" do
    run "#{trollolo_cmd} invalid_command"
    assert_exit_status 1
  end
  
  it "asks for authorization data" do
    run "#{credentials_input_wrapper} get-cards --board-id=myboardid"
    assert_exit_status 0
  end

  describe "burndown chart" do
    use_given_filesystem
    
    it "inits burndown directory" do
      path = given_directory
      run "#{trollolo_cmd} burndown-init -o #{path} --board-id=myboardid"
      assert_exit_status 0
    end
    
    it "fails, if burndown data is not found" do
      path = given_directory
      run "#{trollolo_cmd} burndown -o #{path}"
      assert_exit_status 1
      assert_partial_output "burndown-data-01.yaml' not found", all_stderr
    end
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
trollolo-0.0.6 spec/integration/command_line_spec.rb
trollolo-0.0.5 spec/integration/command_line_spec.rb
trollolo-0.0.4 spec/integration/command_line_spec.rb