Sha256: 893d908d603057105d82785351262e100c71dfb9d1100bfb6a8f88ab95c363c9

Contents?: true

Size: 594 Bytes

Versions: 1

Compression:

Stored size: 594 Bytes

Contents

require 'test_helper'
require_relative '../lib/sandi_meter/cli'

describe SandiMeter::CLI do
  let(:cli) { SandiMeter::CLI }
  
  describe '#execute' do
    before do 
      @original_argv = ARGV
      ARGV.clear
    end
    
    after do 
      ARGV.clear
      ARGV.concat(@original_argv)
    end
    
    context 'with the graph flag passed in' do
      before { ARGV.push('-g') }
      after { ARGV.pop }
      
      it 'opens the graph in a web browser' do
        cli.should_receive(:open_in_browser)
        expect { cli.execute }.to raise_error(SystemExit)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sandi_meter-1.1.7 spec/cli_spec.rb