Sha256: 928d4879d6da8aef5d138567976cf8d0f9c01f94ad7e8f8a7198b042a7c8bf37

Contents?: true

Size: 825 Bytes

Versions: 1

Compression:

Stored size: 825 Bytes

Contents

# encoding: utf-8

require File.expand_path(File.dirname(__FILE__) + '/../test_helper')

describe ::Sparkr::CLI do
  it ".run should work with array of numbers as strings" do
    string_numbers = %w(1 2 3 4 100 5 10 20 50 300)
    out, err = capture_io do
      ::Sparkr::CLI.run(*string_numbers)
    end
    refute out.empty?, "there should be some output"
    assert err.empty?, "there should be no errors"
    assert_equal "▁▁▁▁▃▁▁▁▂█\n", out
  end

  it ".run should print usage information if args are missing or '-h'" do
    [[], ['-h'], ['--help']].each do |args|
      out, err = capture_io do
        ::Sparkr::CLI.run(*args)
      end
      refute out.empty?, "there should be some output"
      assert err.empty?, "there should be no errors"
      assert_match /USAGE\:/, out
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sparkr-0.4.1 test/sparkr/cli_test.rb