Sha256: 2a2a0da905821e1cefd2e732ecc7e39a0b91d7cbb88c0c775a1497342f85f88a

Contents?: true

Size: 789 Bytes

Versions: 1

Compression:

Stored size: 789 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" do
    string_numbers = %w()
    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_match /USAGE\:/, out
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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