Sha256: 3dcba25af8a146ac37c99f6c2e1d2afad71f416cd507a8fd3c5f88e61b67972c

Contents?: true

Size: 671 Bytes

Versions: 2

Compression:

Stored size: 671 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

include Netprint

describe Agent do
  before do
    unless ENV['NETPRINT_USERID'] && ENV['NETPRINT_PASSWORD']
      raise 'set environment variable NETPRINT_USERID and NETPRINT_PASSWORD before running spec'
    end

    @agent = Agent.new(ENV['NETPRINT_USERID'], ENV['NETPRINT_PASSWORD'])
  end

  it 'should login' do
    @agent.should_not be_login

    @agent.login

    @agent.should be_login
  end

  it 'should upload' do
    filename = File.expand_path(File.dirname(__FILE__) + '/../foo.pdf')
    @agent.login

    code = @agent.upload(filename)
    code.should match(/^[0-9A-Z]{8}$/)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
netprint-0.0.2 spec/netprint/agent_spec.rb
netprint-0.0.1 spec/netprint/agent_spec.rb