Sha256: eea37a47cc9d8023a4ae93c671ce8e87ba0dc51b14c4548bec5753d549d47922

Contents?: true

Size: 807 Bytes

Versions: 4

Compression:

Stored size: 807 Bytes

Contents

# frozen_string_literal: true

require 'test_helper'

class Thinreports::Core::Shape::Basic::TestBlockInterface < Minitest::Test
  include Thinreports::TestHelper

  Basic = Thinreports::Core::Shape::Basic

  def setup
    report = Thinreports::Report.new layout: layout_file.path
    parent = report.start_new_page

    format = Basic::BlockFormat.new({})
    internal = Basic::BlockInternal.new parent, format

    @interface = Basic::BlockInterface.new parent, format, internal
  end

  def test_value_should_work_as_reader_with_no_arguments
    @interface.internal.write_value('new value')
    assert_equal @interface.value, 'new value'
  end

  def test_value_should_work_as_writer_with_arguments
    @interface.value('new value')
    assert_equal @interface.internal.read_value, 'new value'
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
thinreports-0.10.3 test/units/core/shape/basic/test_block_interface.rb
thinreports-0.10.2 test/unit/core/shape/basic/test_block_interface.rb
thinreports-0.10.1 test/unit/core/shape/basic/test_block_interface.rb
thinreports-0.10.0 test/unit/core/shape/basic/test_block_interface.rb