Sha256: 8bc80cec127a3ac52122b0401d5dc0f979c3c4559dae202e3382c3621931e9b9

Contents?: true

Size: 641 Bytes

Versions: 4

Compression:

Stored size: 641 Bytes

Contents

require 'spec_helper'

describe 'StockGains::CLI' do 
  cli = StockGains::CLI.new

  describe 'instance' do 
    it 'creates an instance' do 
      expect(cli).to be_an_instance_of(StockGains::CLI)  
    end 
  end

  describe '#valid_input?' do
    it 'is true when the input is "all"' do
      expect(cli.valid_input?(["all"])).to be_truthy
    end 

    it 'is true when the input values are valid' do
      expect(cli.valid_input?(["1, 2, 3"])).to be_truthy
    end

    it 'is false when the input is invalid' do 
      expect(cli.valid_input?(["0"])).to be_falsey
      expect(cli.valid_input?(["none"])).to be_falsey
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
stock-gains-0.1.7 spec/01_cli_spec.rb
stock-gains-0.1.6 spec/01_cli_spec.rb
stock-gains-0.1.5 spec/01_cli_spec.rb
stock-gains-0.1.3 spec/01_cli_spec.rb