Sha256: 24515a20fa273ee63f47956a97f628c809c46625e40bd15546d540072ac791ca

Contents?: true

Size: 930 Bytes

Versions: 4

Compression:

Stored size: 930 Bytes

Contents

require 'spec_helper'

class ScreenFactoryScreen
  include TE3270
end

class World
  include TE3270::ScreenFactory
end

describe TE3270::ScreenFactory do

  let(:world) { World.new }

  it 'should create a new screen object' do
    emulator = double('platform')
    world.instance_variable_set('@emulator', emulator)
    world.on(ScreenFactoryScreen).should be_instance_of ScreenFactoryScreen
  end

  it 'should create a new screen object and execute a block' do
    emulator = double('platform')
    world.instance_variable_set('@emulator', emulator)
    world.on(ScreenFactoryScreen) do |page|
      page.should be_instance_of ScreenFactoryScreen
    end
  end

  it 'should raise an error when an @emulator instance variable does not exist' do
    expect { world.on(ScreenFactoryScreen) }.to raise_error("@emulator instance variable must be available to use the ScreenFactory methods")
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
te3270-0.3-x86-mingw32 spec/lib/te3270/screen_factory_spec.rb
te3270-jruby-0.1-universal-java-1.7 spec/lib/te3270/screen_factory_spec.rb
te3270-0.2-x86-mingw32 spec/lib/te3270/screen_factory_spec.rb
te3270-0.1-x86-mingw32 spec/lib/te3270/screen_factory_spec.rb