Sha256: c9bef968ab852f369cb7e29f778a28fff58d2107269e18294d1264c43fad07bd

Contents?: true

Size: 696 Bytes

Versions: 1

Compression:

Stored size: 696 Bytes

Contents

require 'spec_helper'
require 'getoptions'

describe GmailCli::Shell do

  let(:getoptions) { GetOptions.new(GmailCli::Shell::OPTIONS, options) }
  let(:shell) { GmailCli::Shell.new(getoptions,argv) }

  before do
    allow($stderr).to receive(:puts) # silence console feedback chatter
  end

  describe "#usage" do
    let(:options) { ['-h'] }
    let(:argv) { [] }
    it "prints usage when run" do
      expect(shell).to receive(:usage)
      shell.run
    end
  end

  describe "#authorize" do
    let(:options) { [] }
    let(:argv) { ["authorize"] }
    it "should invoke authorize when run" do
      expect(GmailCli::Oauth2Helper).to receive(:authorize!)
      shell.run
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gmail_cli-0.1.0 spec/unit/shell_spec.rb