diff options
| author | lstrzebinczyk <[email protected]> | 2017-03-20 21:35:07 +0100 |
|---|---|---|
| committer | Tom Black <[email protected]> | 2017-03-27 13:45:54 -0400 |
| commit | 79c50dab7f06e4ec288e79e61d0631fdf07b7264 (patch) | |
| tree | 810156ff621084c9bf6268b1f4577ba82fb19b3e /test | |
| parent | 54b00eb9d3cba566bf80daf6be4c93c1149a7633 (diff) | |
| download | ruby2d-79c50dab7f06e4ec288e79e61d0631fdf07b7264.tar.gz ruby2d-79c50dab7f06e4ec288e79e61d0631fdf07b7264.zip | |
Text#text= will inspect it's input
Diffstat (limited to 'test')
| -rw-r--r-- | test/text_spec.rb | 18 |
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 |
