Sha256: 5957ffe229f7bc770319fb52dad4362544598b1c347ec284b6f634230d367f16

Contents?: true

Size: 605 Bytes

Versions: 1

Compression:

Stored size: 605 Bytes

Contents

require 'spec_helper'

describe Gista::LoginPrompt do
  let(:output) { StringIO.new }
  let(:input)  { StringIO.new("username\npassword\n") }

  before do
    $stdout = output
    $stdin  = input
  end

  after do
    $stdout = STDOUT
    $stdin  = STDIN
  end

  it 'should ask for username and password' do
    subject.username
    output.string.should include('Please authenticate with your Github credentials:')
    output.string.should include('Username: ')
    output.string.should include('Password: ')
  end

  its(:username) { should == 'username' }
  its(:password) { should == 'password' }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gista-1.0.0 spec/gista/login_prompt_spec.rb