Skip to content

Commit

Permalink
Merge pull request #23 from jrmhaig/update_dependency_versions
Browse files Browse the repository at this point in the history
Update dependency versions
  • Loading branch information
jrmhaig authored Jan 9, 2018
2 parents 0a4b8ab + dd74619 commit a184cfb
Show file tree
Hide file tree
Showing 15 changed files with 54 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0
2.5.0
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ rvm:
- 1.9.2
- 1.9.3
- 2.0.0
- 2.1.0
- 2.2.0
- 2.3.6
- 2.4.3
- 2.5.0
branches:
only:
- master
5 changes: 2 additions & 3 deletions Gemfile.ci
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Gemfile for Travis. Doesn't require gosu which doesn't compile in Travis
source 'https://rubygems.org'

gem 'rspec'
gem 'rspec-mocks'
gem 'configuration'
gem 'rspec', '~> 3.7.0'
gem 'configuration', '~> 1.3.4'
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ RTanque is based on the Java project [Robocode](http://robocode.sourceforge.net/
## Requirements

* The [Gosu](https://github.com/jlnr/gosu) library used for rendering has some dependencies. Use the [Gosu getting started](https://github.com/jlnr/gosu/wiki/Getting-Started-on-Linux) to resolve any for your system.
* Ruby 2.0.0 or 1.9.3 (tested on 1.8.7 and 1.9.2)
* Ruby 2.2 or later (also tested on earlier versions)

## Quick Start

Expand Down
2 changes: 1 addition & 1 deletion bin/rtanque
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ LONGDESC
puts set_color("Error! Gist #{gist_id} not found. Please ensure the gist id is correct.", :red)
else
gist.files.attrs.each do |name, gist_file|
gist_path = "#{BOT_DIR}/#{gist.user.login}.#{gist_id}/#{name}"
gist_path = "#{BOT_DIR}/#{gist.owner.login}.#{gist_id}/#{name}"
create_file(gist_path, gist_file.content, options)
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/rtanque/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module RTanque
VERSION = '0.1.2'
VERSION = '0.1.3'
end
13 changes: 6 additions & 7 deletions rtanque.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@ Have fun competing against friends' tanks or the sample ones included. Maybe you
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.require_paths = ["lib"]

gem.add_dependency 'gosu', '~> 0.7.45'
gem.add_dependency 'configuration', '~> 1.3.2'
gem.add_dependency 'octokit', '~> 2.7.0'
gem.add_dependency 'thor', '~> 0.17.0'
gem.add_dependency 'texplay'
gem.add_dependency 'gosu', '~> 0.13.1'
gem.add_dependency 'configuration', '~> 1.3.4'
gem.add_dependency 'octokit', '~> 4.8.0'
gem.add_dependency 'thor', '~> 0.20.0'
gem.add_dependency 'texplay', '>= 0.4.4pre'

gem.add_development_dependency 'pry'
gem.add_development_dependency 'rspec', '~> 2.13.0'
gem.add_development_dependency 'rspec-mocks', '~> 2.13.0'
gem.add_development_dependency 'rspec', '~> 3.7.0'
end
4 changes: 2 additions & 2 deletions spec/rtanque/bot_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

context '#dead?' do
it 'should not initially be dead' do
expect(bot.dead?).to be_false
expect(bot.dead?).to be_falsey
end

it 'should be true if health is below min' do
bot.health = RTanque::Configuration.bot.health.min - 1
expect(bot.dead?).to be_true
expect(bot.dead?).to be_truthy
end
end

Expand Down
16 changes: 8 additions & 8 deletions spec/rtanque/heading_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
end

it 'creates frozen object' do
expect(described_class.new(0).frozen?).to be_true
expect(described_class.new(0).frozen?).to be_truthy
end
end

Expand All @@ -135,43 +135,43 @@
describe '#==' do
it 'works like Numeric, ignoring type' do
a = described_class.new(1.0)
expect(a == 1).to be_true
expect(a == 1).to be_truthy
end

it 'correctly compares two equal headings' do
a = described_class.new(1.0)
b = described_class.new(1.0)
expect(a == b).to be_true
expect(a == b).to be_truthy
end

it 'correctly compares two different headings' do
a = described_class.new(0)
b = described_class.new(1.0)
expect(a == b).to be_false
expect(a == b).to be_falsey
end

it 'compares to a numeric on LHS' do
a = described_class.new(Math::PI)
expect(Math::PI == a).to be_true
expect(Math::PI == a).to be_truthy
end
end

describe '#eql?' do
it 'compares types like Numeric, comparing type' do
a = described_class.new(1.0)
expect(a.eql?(1)).to be_false
expect(a.eql?(1)).to be_falsey
end

it 'correctly compares two equal headings' do
a = described_class.new(1.0)
b = described_class.new(1.0)
expect(a.eql?(b)).to be_true
expect(a.eql?(b)).to be_truthy
end

it 'correctly compares two different headings' do
a = described_class.new(0)
b = described_class.new(1.0)
expect(a.eql?(b)).to be_false
expect(a.eql?(b)).to be_falsey
end
end

Expand Down
8 changes: 4 additions & 4 deletions spec/rtanque/match_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,27 @@
it 'should allow adding bots' do
bot = double('bot')
@instance.add_bots(bot)
expect(@instance.bots.include?(bot)).to be_true
expect(@instance.bots.include?(bot)).to be_truthy
end

describe '#finished?' do
it 'should be true if one or less bots left' do
expect(@instance.finished?).to be_true
expect(@instance.finished?).to be_truthy
end

it 'should be false if two or more bots left' do
bot1 = double('bot', :name => "bot1")
bot2 = double('bot', :name => "bot2")
@instance.add_bots(bot1, bot2)
expect(@instance.finished?).to be_false
expect(@instance.finished?).to be_falsey
end

it 'should be true if two or more bots left w/ same name' do
@instance.teams = true
bot1 = double('bot', :name => "bot1")
bot2 = double('bot', :name => "bot1")
@instance.add_bots(bot1, bot2)
expect(@instance.finished?).to be_true
expect(@instance.finished?).to be_truthy
end
end

Expand Down
8 changes: 3 additions & 5 deletions spec/rtanque/normalized_attr_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
described_class::AttrContainer.new(1..5)
end
let(:attached_instance) do
mock('some_object')
double('some_object')
end

it 'has -infinity as max_delta' do
Expand All @@ -33,13 +33,11 @@
described_class::AttrContainer.new(0..5, lambda{ |attached| attached.max_delta })
end
let(:attached_instance) do
mock('some_object', :max_delta => 0.1)
double('some_object', :max_delta => 0.1)
end

it 'should call block for max_delta' do
attached = mock('some_object')
attached.should_receive(:max_delta).and_return(0.1)
expect(instance.max_delta(attached)).to eq 0.1
expect(instance.max_delta(attached_instance)).to eq 0.1
end

it 'does not allow a change greater than given delta' do
Expand Down
22 changes: 11 additions & 11 deletions spec/rtanque/point_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
context '#initialize' do
it 'should be frozen' do
a = described_class.new(10, 10, @arena)
expect(a.frozen?).to be_true
expect(a.frozen?).to be_truthy
end

it 'should not allow modification' do
Expand Down Expand Up @@ -83,15 +83,15 @@
it 'is true when x & y are equal' do
a = described_class.new(1, 1, @arena)
b = described_class.new(1, 1, @arena)
expect(a == b).to be_true
expect(b == a).to be_true
expect(a == b).to be_truthy
expect(b == a).to be_truthy
end

it 'is not true when x & y are equal' do
a = described_class.new(2, 1, @arena)
b = described_class.new(1, 1, @arena)
expect(a == b).to be_false
expect(b == a).to be_false
expect(a == b).to be_falsey
expect(b == a).to be_falsey
end
end

Expand Down Expand Up @@ -165,32 +165,32 @@

it 'correctly detects equal points' do
@b = @a.clone
expect(@a.within_radius?(@b, 1)).to be_true
expect(@a.within_radius?(@b, 1)).to be_truthy
end

it 'correctly detects point 1 to left' do
@b = described_class.new(4, 5, @arena)
expect(@a.within_radius?(@b, 1)).to be_true
expect(@a.within_radius?(@b, 1)).to be_truthy
end

it 'correctly detects point 1 to right' do
@b = described_class.new(6, 5, @arena)
expect(@a.within_radius?(@b, 1)).to be_true
expect(@a.within_radius?(@b, 1)).to be_truthy
end

it 'correctly detects point 1 above' do
@b = described_class.new(5, 6, @arena)
expect(@a.within_radius?(@b, 1)).to be_true
expect(@a.within_radius?(@b, 1)).to be_truthy
end

it 'correctly detects point 1 below' do
@b = described_class.new(5, 4, @arena)
expect(@a.within_radius?(@b, 1)).to be_true
expect(@a.within_radius?(@b, 1)).to be_truthy
end

it 'correctly detects point 1 NE' do
@b = described_class.new(6, 6, @arena)
expect(@a.within_radius?(@b, 1)).to be_false
expect(@a.within_radius?(@b, 1)).to be_falsey
end
end
end
14 changes: 7 additions & 7 deletions spec/rtanque/radar_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ def reflection(heading, distance, name)

it 'should return an empty array' do
radar.scan([])
expect(radar.empty?).to be_true
expect(radar.empty?).to be_truthy
end

it 'should 1 Reflection' do
radar.scan([mockbot(10, 20)])
expect(radar).to have(1).reflections
expect(radar.instance_variable_get(:@reflections).size).to eq 1
expect(radar.first).to be_an_instance_of described_class::Reflection
end

Expand All @@ -32,7 +32,7 @@ def reflection(heading, distance, name)
it 'should clear self' do
radar.scan([mockbot(10, 20, 'otherbot')])
radar.scan([])
expect(radar.empty?).to be_true
expect(radar.empty?).to be_truthy
end

it 'reflections should be correct' do
Expand All @@ -57,31 +57,31 @@ def reflection(heading, distance, name)
y = 10 + Math.cos(RTanque::Bot::Radar::VISION_RANGE.last) * 10
bots = [mockbot(x, y, 'border')]
radar.scan(bots)
expect(radar.to_a).to have(1).reflections
expect(radar.instance_variable_get(:@reflections).size).to eq 1
end

it 'should detect point on min vision range' do
x = 10 + Math.sin(RTanque::Bot::Radar::VISION_RANGE.first) * 10
y = 10 + Math.cos(RTanque::Bot::Radar::VISION_RANGE.first) * 10
bots = [mockbot(x, y, 'border')]
radar.scan(bots)
expect(radar.to_a).to have(1).reflections
expect(radar.instance_variable_get(:@reflections).size).to eq 1
end

it 'should not detect point outside max vision range' do
x = 10 + Math.sin(RTanque::Bot::Radar::VISION_RANGE.last) * 10
y = 10 + Math.cos(RTanque::Bot::Radar::VISION_RANGE.last) * 10
bots = [mockbot(x + 0.01, y, 'border')]
radar.scan(bots)
expect(radar.to_a).to have(0).reflections
expect(radar.instance_variable_get(:@reflections).size).to eq 0
end

it 'should not detect point outside max vision range' do
x = 10 + Math.sin(RTanque::Bot::Radar::VISION_RANGE.first) * 10
y = 10 + Math.cos(RTanque::Bot::Radar::VISION_RANGE.first) * 10
bots = [mockbot(x, y - 0.01, 'border')]
radar.scan(bots)
expect(radar.to_a).to have(0).reflections
expect(radar.instance_variable_get(:@reflections).size).to eq 0
end
end
end
4 changes: 2 additions & 2 deletions spec/rtanque/shell_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

it 'shell should be dead after hit' do
bots = [mockbot(10, 10, 'deadbot')]
expect(shell.dead?).to be_false
expect(shell.dead?).to be_falsey
shell.hits(bots)
expect(shell.dead?).to be_true
expect(shell.dead?).to be_truthy
end

it 'should hit shell on bot radius' do
Expand Down
1 change: 0 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
require 'rtanque'

RSpec.configure do |config|
config.treat_symbols_as_metadata_keys_with_true_values = true
config.run_all_when_everything_filtered = true

# Run specs in random order to surface order dependencies. If you find an
Expand Down

0 comments on commit a184cfb

Please sign in to comment.