Sha256: a520753468f229d56dafa971d71d12cb71885f0add9536be5edf5afeebf1bd1f
Contents?: true
Size: 1.79 KB
Versions: 20
Compression:
Stored size: 1.79 KB
Contents
require 'test_helper' module Vedeu module Output describe Direct do let(:described) { Vedeu::Output::Direct } let(:instance) { described.new(value: _value, x: x, y: y) } let(:_value) {} let(:x) {} let(:y) {} describe '#initialize' do it { instance.must_be_instance_of(described) } context 'when no value is given' do it { instance.instance_variable_get('@value').must_equal('') } end context 'when a value is given' do let(:_value) { 'some value' } it { instance.instance_variable_get('@value').must_equal('some value') } end context 'when no x is given' do it { instance.instance_variable_get('@x').must_equal(1) } end context 'when an x is given' do let(:x) { 6 } it { instance.instance_variable_get('@x').must_equal(6) } end context 'when no y is given' do it { instance.instance_variable_get('@y').must_equal(1) } end context 'when a y is given' do let(:y) { 3 } it { instance.instance_variable_get('@y').must_equal(3) } end end describe '.write' do before { Vedeu::Terminal.stubs(:output) } subject { described.write(value: _value, x: x, y: y) } it { subject.must_be_instance_of(String) } context 'when a value is given' do let(:_value) { 'some value' } it { subject.must_equal("\e[1;1Hsome value") } end context 'when a value is not given' do it { subject.must_equal("\e[1;1H") } end end describe '#write' do it { instance.must_respond_to(:write) } end end # Direct end # Output end # Vedeu
Version data entries
20 entries across 20 versions & 1 rubygems