summaryrefslogtreecommitdiffhomepage
path: root/test/text_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/text_spec.rb')
-rw-r--r--test/text_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/text_spec.rb b/test/text_spec.rb
new file mode 100644
index 0000000..22e17a3
--- /dev/null
+++ b/test/text_spec.rb
@@ -0,0 +1,18 @@
+require 'ruby2d'
+
+RSpec.describe Ruby2D::Text do
+
+ describe '#text=' do
+ it 'maps Time to string' do
+ t = Text.new(0, 0, Time.now, 40, "test/media/bitstream_vera/vera.ttf")
+ t.text = Time.new(1, 1, 1, 1, 1, 1, 1)
+ expect(t.text).to eq "0001-01-01 01:01:01 +0000"
+ end
+
+ it 'maps Number to string' do
+ t = Text.new(0, 0, 0, 40, "test/media/bitstream_vera/vera.ttf")
+ t.text = 0
+ expect(t.text).to eq "0"
+ end
+ end
+end