Sha256: 5d6e7279cb8353256e62e071d62354ab236f972a5fe8d4c986ac7448fe892ccd

Contents?: true

Size: 1.11 KB

Versions: 2

Compression:

Stored size: 1.11 KB

Contents

require_relative 'spec_helper'
require_relative 'helpers'

describe NATOPhone::NATOPhoneCLI do

  let(:cli) {NATOPhone::NATOPhoneCLI}

  describe "#encode" do
    it "encodes" do
      printed = capture_stdout do
        test = lambda {cli.start(['encode', 'hello world'])}
        test.call
      end
      expect(printed).to eq "\nhotel echo lima lima oscar - whiskey oscar romeo lima delta\n\n"
    end
    it "encodes" do
      printed = capture_stdout do
        test = lambda {cli.start(['encode', 'hello', 'world'])}
        test.call
      end
      expect(printed).to eq "\nhotel echo lima lima oscar - whiskey oscar romeo lima delta\n\n"
    end
  end

  describe "#decode" do
    it "decodes" do
      printed = capture_stdout do
        test = lambda {cli.start(['decode', 'hotel echo lima lima oscar - whiskey oscar romeo lima delta'])}
        test.call
      end
      expect(printed).to eq "\nhello world\n\n"
    end
    it "decodes" do
      printed = capture_stdout do
        test = lambda {cli.start(['decode', 'hotel', 'echo'])}
        test.call
      end
      expect(printed).to eq "\nhe\n\n"
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
natophone-0.0.3 spec/cli_spec.rb
natophone-0.0.2 spec/cli_spec.rb