summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorTom Black <[email protected]>2017-05-19 19:57:58 -0400
committerTom Black <[email protected]>2017-05-20 21:40:40 -0400
commit09ed2811ad3ccb9af50028447fabbcee5b5c5ae2 (patch)
treefb79eb28497e2ccc2d44b86a40034984649e9eb3 /test
parent6ab1ad93c6ae1704fee0adb77dbcf8c721913a73 (diff)
downloadruby2d-09ed2811ad3ccb9af50028447fabbcee5b5c5ae2.tar.gz
ruby2d-09ed2811ad3ccb9af50028447fabbcee5b5c5ae2.zip
Remove trailing whitespace everywhere
It's what all the kids are doing
Diffstat (limited to 'test')
-rw-r--r--test/color_spec.rb14
-rw-r--r--test/dsl_spec.rb8
-rw-r--r--test/image_spec.rb4
-rw-r--r--test/spec_helper.rb4
-rw-r--r--test/sprite_spec.rb4
-rw-r--r--test/testcard.rb6
-rw-r--r--test/text_spec.rb4
7 files changed, 22 insertions, 22 deletions
diff --git a/test/color_spec.rb b/test/color_spec.rb
index 0fb65c8..299f403 100644
--- a/test/color_spec.rb
+++ b/test/color_spec.rb
@@ -1,37 +1,37 @@
require 'ruby2d'
RSpec.describe Ruby2D::Color do
-
+
describe '#is_valid?' do
it 'determines if a color string is valid' do
expect(Ruby2D::Color.is_valid? 'red').to eq true
expect(Ruby2D::Color.is_valid? 'balloons').to eq false
end
-
+
it 'determines if a color string is a valid hex value' do
expect(Ruby2D::Color.is_valid? '#c0c0c0').to eq true
expect(Ruby2D::Color.is_valid? '#00000').to eq false
expect(Ruby2D::Color.is_valid? '123456').to eq false
end
-
+
it 'determines if an array is a valid color' do
expect(Ruby2D::Color.is_valid? [1, 0, 0.0, 1.0]).to eq true
expect(Ruby2D::Color.is_valid? [1.0, 0, 0]).to eq false
end
-
+
it 'prevents color values that are out of range' do
expect(Ruby2D::Color.is_valid? [1.2, 0, 0, 0]).to eq false
expect(Ruby2D::Color.is_valid? [0, 0, -0.1, 0]).to eq false
expect(Ruby2D::Color.is_valid? [0, 0, 0, 2]).to eq false
end
end
-
+
describe '#new' do
it 'raises error on bad color' do
expect { Ruby2D::Color.new 42 }.to raise_error Ruby2D::Error
end
end
-
+
describe '#opacity' do
it 'sets and returns the opacity' do
s1 = Square.new
@@ -42,5 +42,5 @@ RSpec.describe Ruby2D::Color do
expect(s2.opacity).to eq 0.7
end
end
-
+
end
diff --git a/test/dsl_spec.rb b/test/dsl_spec.rb
index 522b29e..4337046 100644
--- a/test/dsl_spec.rb
+++ b/test/dsl_spec.rb
@@ -2,7 +2,7 @@ require 'ruby2d'
include Ruby2D::DSL
RSpec.describe Ruby2D::DSL do
-
+
describe '#get' do
it 'gets the default window attributes' do
expect(get :width).to eq 640
@@ -10,7 +10,7 @@ RSpec.describe Ruby2D::DSL do
expect(get :title).to eq "Ruby 2D"
end
end
-
+
describe '#set' do
it 'sets a single window attribute' do
set width: 300
@@ -18,7 +18,7 @@ RSpec.describe Ruby2D::DSL do
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
@@ -26,5 +26,5 @@ RSpec.describe Ruby2D::DSL do
expect(get :title).to eq "Hello tests!"
end
end
-
+
end
diff --git a/test/image_spec.rb b/test/image_spec.rb
index 43950c9..3eb5d86 100644
--- a/test/image_spec.rb
+++ b/test/image_spec.rb
@@ -1,11 +1,11 @@
require 'ruby2d'
RSpec.describe Ruby2D::Image do
-
+
describe '#new' do
it "raises exception if image file doesn't exist" do
expect { Image.new(0, 0, 'bad_image.png') }.to raise_error(Ruby2D::Error)
end
end
-
+
end
diff --git a/test/spec_helper.rb b/test/spec_helper.rb
index d93bff8..b69dfa6 100644
--- a/test/spec_helper.rb
+++ b/test/spec_helper.rb
@@ -2,11 +2,11 @@ RSpec.configure do |config|
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end
-
+
config.mock_with :rspec do |mocks|
mocks.verify_partial_doubles = true
end
-
+
# Silence output when running tests
original_stderr = $stderr
original_stdout = $stdout
diff --git a/test/sprite_spec.rb b/test/sprite_spec.rb
index 42268be..441ca6e 100644
--- a/test/sprite_spec.rb
+++ b/test/sprite_spec.rb
@@ -1,11 +1,11 @@
require 'ruby2d'
RSpec.describe Ruby2D::Sprite do
-
+
describe '#new' do
it 'creates a new sprite' do
Ruby2D::Sprite.new(0, 0, "tests/media/sprite_sheet.png")
end
end
-
+
end
diff --git a/test/testcard.rb b/test/testcard.rb
index a6341c7..b573579 100644
--- a/test/testcard.rb
+++ b/test/testcard.rb
@@ -239,16 +239,16 @@ end
update do
pointer.x = (get :mouse_x) - 5
pointer.y = (get :mouse_y) - 7
-
+
if flash > 0
pointer_outline.color = [0, 1, 0, 1]
flash -= 1
else
pointer_outline.color = [0, 1, 0, 0]
end
-
+
s1.animate(:forwards)
-
+
if (get :frames) % 20 == 0
fps.text = "FPS: #{(get :fps).round(3)}"
end
diff --git a/test/text_spec.rb b/test/text_spec.rb
index 1dc6189..ad12cbf 100644
--- a/test/text_spec.rb
+++ b/test/text_spec.rb
@@ -1,14 +1,14 @@
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