diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/dsl_spec.rb | 18 | ||||
| -rw-r--r-- | test/events_spec.rb | 18 | ||||
| -rw-r--r-- | test/text_spec.rb | 4 |
3 files changed, 20 insertions, 20 deletions
diff --git a/test/dsl_spec.rb b/test/dsl_spec.rb index dd85f77..063abd2 100644 --- a/test/dsl_spec.rb +++ b/test/dsl_spec.rb @@ -5,25 +5,25 @@ 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" + 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" + 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!" + expect(get :width).to eq(800) + expect(get :height).to eq(600) + expect(get :title).to eq("Hello tests!") end end diff --git a/test/events_spec.rb b/test/events_spec.rb index ab07209..cff8c95 100644 --- a/test/events_spec.rb +++ b/test/events_spec.rb @@ -19,7 +19,7 @@ RSpec.describe Ruby2D::Window do end callback_event_name = key_event_type.to_s.gsub("key_", "").to_sym window.key_callback(callback_event_name, "example_key") - expect(value).to eq 1 + expect(value).to eq(1) end it "allows binding of multiple events" do @@ -33,7 +33,7 @@ RSpec.describe Ruby2D::Window do end callback_event_name = key_event_type.to_s.gsub("key_", "").to_sym window.key_callback(callback_event_name, "example_key") - expect(value).to eq 3 + expect(value).to eq(3) end it "returns value, which can be used to unbind event" do @@ -45,7 +45,7 @@ RSpec.describe Ruby2D::Window do window.off(event_descriptor) callback_event_name = key_event_type.to_s.gsub("key_", "").to_sym window.key_callback(callback_event_name, "example_key") - expect(value).to eq 0 + expect(value).to eq(0) end end end @@ -60,7 +60,7 @@ RSpec.describe Ruby2D::Window do end callback_event_name = key_event_type.to_s.gsub("mouse_", "").to_sym window.mouse_callback(callback_event_name, nil, nil, 0, 0, 0, 0) - expect(value).to eq 1 + expect(value).to eq(1) end it "allows binding of multiple events" do @@ -74,7 +74,7 @@ RSpec.describe Ruby2D::Window do end callback_event_name = key_event_type.to_s.gsub("mouse_", "").to_sym window.mouse_callback(callback_event_name, nil, nil, 0, 0, 0, 0) - expect(value).to eq 3 + expect(value).to eq(3) end it "returns value, which can be used to unbind event" do @@ -86,7 +86,7 @@ RSpec.describe Ruby2D::Window do window.off(event_descriptor) callback_event_name = key_event_type.to_s.gsub("mouse_", "").to_sym window.mouse_callback(callback_event_name, nil, nil, 0, 0, 0, 0) - expect(value).to eq 0 + expect(value).to eq(0) end end end @@ -101,7 +101,7 @@ RSpec.describe Ruby2D::Window do end callback_event_name = key_event_type.to_s.gsub("controller_", "").to_sym window.controller_callback(nil, callback_event_name, nil, nil, nil) - expect(value).to eq 1 + expect(value).to eq(1) end it "allows binding of multiple events" do @@ -115,7 +115,7 @@ RSpec.describe Ruby2D::Window do end callback_event_name = key_event_type.to_s.gsub("controller_", "").to_sym window.controller_callback(nil, callback_event_name, nil, nil, nil) - expect(value).to eq 3 + expect(value).to eq(3) end it "returns value, which can be used to unbind event" do @@ -127,7 +127,7 @@ RSpec.describe Ruby2D::Window do window.off(event_descriptor) callback_event_name = key_event_type.to_s.gsub("controller_", "").to_sym window.controller_callback(nil, callback_event_name, nil, nil, nil) - expect(value).to eq 0 + expect(value).to eq(0) end end end diff --git a/test/text_spec.rb b/test/text_spec.rb index 6e0ba09..9a79532 100644 --- a/test/text_spec.rb +++ b/test/text_spec.rb @@ -12,13 +12,13 @@ RSpec.describe Ruby2D::Text do it 'maps Time to string' do t = Text.new(font: "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" + expect(t.text).to eq("0001-01-01 01:01:01 +0000") end it "maps Number to string" do t = Text.new(font: "test/media/bitstream_vera/vera.ttf") t.text = 0 - expect(t.text).to eq "0" + expect(t.text).to eq("0") end end |
