diff options
| author | Tom Black <[email protected]> | 2016-12-24 22:17:34 -0600 |
|---|---|---|
| committer | Tom Black <[email protected]> | 2016-12-24 22:17:34 -0600 |
| commit | e81d32b470cdead1c114b6d1b5b6bda958d6b1ad (patch) | |
| tree | 3d61e376c8f460b2ff932cb9f9104f2e0cf5b72e /test/dsl_spec.rb | |
| parent | 326b74d485ce81c0a4e1da0e5158a2c83e028915 (diff) | |
| download | ruby2d-e81d32b470cdead1c114b6d1b5b6bda958d6b1ad.tar.gz ruby2d-e81d32b470cdead1c114b6d1b5b6bda958d6b1ad.zip | |
Merge all tests into `test/` directory
Diffstat (limited to 'test/dsl_spec.rb')
| -rw-r--r-- | test/dsl_spec.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/dsl_spec.rb b/test/dsl_spec.rb new file mode 100644 index 0000000..6d3d8b4 --- /dev/null +++ b/test/dsl_spec.rb @@ -0,0 +1,29 @@ +require 'ruby2d' + +RSpec.describe Ruby2D::DSL do + + describe '#get' do + it 'gets the default window attributes' do + expect(get :width).to eq 640 + expect(get :height).to eq 480 + expect(get :title).to eq "Ruby 2D" + end + end + + describe '#set' do + it 'sets a single window attribute' do + set width: 300 + expect(get :width).to eq 300 + expect(get :height).to eq 480 + expect(get :title).to eq "Ruby 2D" + end + + it 'sets multiple window attributes at a time' do + set width: 800, height: 600, title: "Hello tests!" + expect(get :width).to eq 800 + expect(get :height).to eq 600 + expect(get :title).to eq "Hello tests!" + end + end + +end |
