Sha256: e48c9b16de9062c3936531a26769fe32da2ccc8b5eab5d343f0446da67f82f04
Contents?: true
Size: 1018 Bytes
Versions: 13
Compression:
Stored size: 1018 Bytes
Contents
require 'test_helper' module Vedeu class VedeuCommonClass include Vedeu::Common def defined_value_test(variable) defined_value?(variable) end end # VedeuCommonClass describe Common do let(:described) { Vedeu::VedeuCommonClass.new } describe '#defined_value?' do subject { described.defined_value_test(_value) } context 'when the variable is a Fixnum' do let(:_value) { 17 } it { subject.must_equal(true) } end context 'when the variable is not nil or empty' do let(:_value) { 'not empty' } it { subject.must_equal(true) } end context 'when the variable is nil or empty' do let(:_value) { [] } it { subject.must_equal(false) } end context 'when dealing with keys which may not exist or have a value' do let(:attributes) { {} } let(:_value) { attributes[:not_found] } it { subject.must_equal(false) } end end end # Common end # Vedeu
Version data entries
13 entries across 13 versions & 1 rubygems