test/lib/vedeu/common_test.rb in vedeu-0.8.12 vs test/lib/vedeu/common_test.rb in vedeu-0.8.13
- old
+ new
@@ -206,10 +206,12 @@
describe '#numeric?' do
let(:_value) {}
subject { instance.numeric?(_value) }
+ it { instance.must_respond_to(:fixnum?) }
+
context 'when the value is numeric' do
let(:_value) { 16 }
it { subject.must_equal(true) }
end
@@ -217,10 +219,35 @@
context 'when the value is not numeric' do
it { subject.must_equal(false) }
end
end
+ describe '#positionable?' do
+ subject { instance.positionable?(_value) }
+
+ context 'when it does not respond to position' do
+ let(:_value) { '' }
+
+ it { subject.must_equal(false) }
+ end
+
+ context 'when it responds to position' do
+ let(:_value) { Vedeu::Cells::Empty.new(position: position) }
+ let(:position) { false }
+
+ context 'when the position is a Vedeu::Geometries::Position' do
+ let(:position) { Vedeu::Geometries::Position.new }
+
+ it { subject.must_equal(true) }
+ end
+
+ context 'when the position is not a Vedeu::Geometries::Position' do
+ it { subject.must_equal(false) }
+ end
+ end
+ end
+
describe '#present?' do
subject { instance.defined_value_test(_value) }
context 'when the variable is a Fixnum' do
let(:_value) { 17 }
@@ -322,9 +349,25 @@
it { subject.must_equal(true) }
end
context 'when the value is not string' do
+ it { subject.must_equal(false) }
+ end
+ end
+
+ describe '#symbol?' do
+ let(:_value) {}
+
+ subject { instance.symbol?(_value) }
+
+ context 'when the value is a Symbol' do
+ let(:_value) { :test }
+
+ it { subject.must_equal(true) }
+ end
+
+ context 'when the value is not a Symbol' do
it { subject.must_equal(false) }
end
end
describe '#truthy?' do