Sha256: 3b09d240b9b6dd6121d372e04e421fece0e7344f0ffe366eba6735f154b4eab2

Contents?: true

Size: 946 Bytes

Versions: 4

Compression:

Stored size: 946 Bytes

Contents

require 'spec_helper'

class ScreenPopulatorScreen
  include TE3270

  text_field(:editable, 1, 2, 10, true)
  text_field(:read_only, 2, 3, 12, false)
end

describe TE3270::ScreenPopulator do

  let(:platform) { double('platform') }
  let(:screen_object) { ScreenPopulatorScreen.new platform }

  it 'should set a value in a text field' do
    platform.should_receive(:put_string).with('the_value', 1, 2)
    screen_object.populate_screen_with editable: 'the_value'
  end

  it 'should not set a value when a text field is read only' do
    platform.should_not_receive(:put_string)
    screen_object.populate_screen_with read_only: 'the_value'
  end

  it 'should attempt to set all values from the provided Hash' do
    platform.should_receive(:put_string).with('the_value', 1, 2)
    platform.should_not_receive(:put_string).with('read_only', 2, 3)
    screen_object.populate_screen_with(editable: 'the_value', read_only: 'read_only')
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
te3270-0.7.1 spec/lib/te3270/screen_populator_spec.rb
te3270-0.7.0 spec/lib/te3270/screen_populator_spec.rb
te3270-0.6.0 spec/lib/te3270/screen_populator_spec.rb
te3270-0.5.0-x86_64-darwin-14 spec/lib/te3270/screen_populator_spec.rb