mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-17 07:40:12 +01:00
merge upstream changes
This commit is contained in:
parent
4e890524f0
commit
a095f8cb0e
9 changed files with 291 additions and 291 deletions
|
|
@ -1,50 +1,50 @@
|
||||||
1. Wiki
|
1. Wiki
|
||||||
|
|
||||||
There are some pointers for setting up your Tracks copy for testing at http://dev.rousette.org.uk/wiki/Tracks/Testing
|
There are some pointers for setting up your Tracks copy for testing at http://dev.rousette.org.uk/wiki/Tracks/Testing
|
||||||
|
|
||||||
2. SQLITE3 FOR TESTING
|
2. SQLITE3 FOR TESTING
|
||||||
|
|
||||||
By default, tests are configured to run using sqlite3 in memory mode to increase speed. You will need the sqlite3-ruby gem for this.
|
By default, tests are configured to run using sqlite3 in memory mode to increase speed. You will need the sqlite3-ruby gem for this.
|
||||||
|
|
||||||
To avoid showing the migrations as tests are run, add the following to your database.yml below 'database: ":memory:"':
|
To avoid showing the migrations as tests are run, add the following to your database.yml below 'database: ":memory:"':
|
||||||
|
|
||||||
verbosity: quiet
|
verbosity: quiet
|
||||||
|
|
||||||
If you want to run tests using another database, that's fine, too. Just change your database.yml accordingly.
|
If you want to run tests using another database, that's fine, too. Just change your database.yml accordingly.
|
||||||
|
|
||||||
3. SELENIUM TESTS (Selenium on Rails)
|
3. SELENIUM TESTS (Selenium on Rails)
|
||||||
|
|
||||||
This testing style is deprecated and are being moved over to Selenium via RSpec stories by lukemelia (See #4 below for the new style).
|
This testing style is deprecated and are being moved over to Selenium via RSpec stories by lukemelia (See #4 below for the new style).
|
||||||
|
|
||||||
To run selenium tests, start Tracks in test mode using
|
To run selenium tests, start Tracks in test mode using
|
||||||
|
|
||||||
script/server -e test
|
script/server -e test
|
||||||
|
|
||||||
Then open a browser to
|
Then open a browser to
|
||||||
|
|
||||||
http://localhost:3000/selenium/
|
http://localhost:3000/selenium/
|
||||||
|
|
||||||
and interact with the test runner.
|
and interact with the test runner.
|
||||||
|
|
||||||
For more information about Selenium on Rails, see vendor/plugins/selenium-on-rails/README
|
For more information about Selenium on Rails, see vendor/plugins/selenium-on-rails/README
|
||||||
|
|
||||||
4. RSPEC STORY RUNNER TESTS
|
4. RSPEC STORY RUNNER TESTS
|
||||||
|
|
||||||
To run the stories, which are browser tests using selenium, start Tracks in test mode using
|
To run the stories, which are browser tests using selenium, start Tracks in test mode using
|
||||||
|
|
||||||
rake db:test:prepare
|
rake db:test:prepare
|
||||||
script/server -e test
|
script/server -e test
|
||||||
|
|
||||||
Then start Selenium by running
|
Then start Selenium by running
|
||||||
|
|
||||||
selenium
|
selenium
|
||||||
|
|
||||||
which is a script installed with the Selenium gem (sudo gem install Selenium)
|
which is a script installed with the Selenium gem (sudo gem install Selenium)
|
||||||
|
|
||||||
Once the site and selenium server are running, then run all stories with
|
Once the site and selenium server are running, then run all stories with
|
||||||
|
|
||||||
script/story
|
script/story
|
||||||
|
|
||||||
or a specific set with
|
or a specific set with
|
||||||
|
|
||||||
script/story stories/login/*.story
|
script/story stories/login/*.story
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,23 @@
|
||||||
module Spec
|
module Spec
|
||||||
module Rails
|
module Rails
|
||||||
module VERSION #:nodoc:
|
module VERSION #:nodoc:
|
||||||
BUILD_TIME_UTC = 20080615141040
|
BUILD_TIME_UTC = 20080615141040
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Verify that the plugin has the same revision as RSpec
|
# Verify that the plugin has the same revision as RSpec
|
||||||
if Spec::Rails::VERSION::BUILD_TIME_UTC != Spec::VERSION::BUILD_TIME_UTC
|
if Spec::Rails::VERSION::BUILD_TIME_UTC != Spec::VERSION::BUILD_TIME_UTC
|
||||||
raise <<-EOF
|
raise <<-EOF
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
Your RSpec on Rails plugin is incompatible with your installed RSpec.
|
Your RSpec on Rails plugin is incompatible with your installed RSpec.
|
||||||
|
|
||||||
RSpec : #{Spec::VERSION::BUILD_TIME_UTC}
|
RSpec : #{Spec::VERSION::BUILD_TIME_UTC}
|
||||||
RSpec on Rails : #{Spec::Rails::VERSION::BUILD_TIME_UTC}
|
RSpec on Rails : #{Spec::Rails::VERSION::BUILD_TIME_UTC}
|
||||||
|
|
||||||
Make sure your RSpec on Rails plugin is compatible with your RSpec gem.
|
Make sure your RSpec on Rails plugin is compatible with your RSpec gem.
|
||||||
See http://rspec.rubyforge.org/documentation/rails/install.html for details.
|
See http://rspec.rubyforge.org/documentation/rails/install.html for details.
|
||||||
############################################################################
|
############################################################################
|
||||||
EOF
|
EOF
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,21 @@
|
||||||
Story: cells with less than two neighbours die
|
Story: cells with less than two neighbours die
|
||||||
|
|
||||||
As a game producer
|
As a game producer
|
||||||
I want cells with less than two neighbours to die
|
I want cells with less than two neighbours to die
|
||||||
So that I can illustrate how the game works to people with money
|
So that I can illustrate how the game works to people with money
|
||||||
|
|
||||||
Scenario: cells with zero or one neighbour die
|
Scenario: cells with zero or one neighbour die
|
||||||
|
|
||||||
Given the grid looks like
|
Given the grid looks like
|
||||||
........
|
........
|
||||||
.XX.XX..
|
.XX.XX..
|
||||||
.XX.....
|
.XX.....
|
||||||
....X...
|
....X...
|
||||||
........
|
........
|
||||||
When the next step occurs
|
When the next step occurs
|
||||||
Then the grid should look like
|
Then the grid should look like
|
||||||
........
|
........
|
||||||
.XX.....
|
.XX.....
|
||||||
.XX.....
|
.XX.....
|
||||||
........
|
........
|
||||||
........
|
........
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,21 @@
|
||||||
Story: cells with more than three neighbours die
|
Story: cells with more than three neighbours die
|
||||||
|
|
||||||
As a game producer
|
As a game producer
|
||||||
I want cells with more than three neighbours to die
|
I want cells with more than three neighbours to die
|
||||||
So that I can show the people with money how we are getting on
|
So that I can show the people with money how we are getting on
|
||||||
|
|
||||||
Scenario: blink
|
Scenario: blink
|
||||||
|
|
||||||
Given the grid looks like
|
Given the grid looks like
|
||||||
.....
|
.....
|
||||||
...XX
|
...XX
|
||||||
...XX
|
...XX
|
||||||
.XX..
|
.XX..
|
||||||
.XX..
|
.XX..
|
||||||
When the next step occurs
|
When the next step occurs
|
||||||
Then the grid should look like
|
Then the grid should look like
|
||||||
.....
|
.....
|
||||||
...XX
|
...XX
|
||||||
....X
|
....X
|
||||||
.X...
|
.X...
|
||||||
.XX..
|
.XX..
|
||||||
|
|
|
||||||
|
|
@ -1,42 +1,42 @@
|
||||||
Story: Empty spaces with three neighbours create a cell
|
Story: Empty spaces with three neighbours create a cell
|
||||||
|
|
||||||
As a game producer
|
As a game producer
|
||||||
I want empty cells with three neighbours to die
|
I want empty cells with three neighbours to die
|
||||||
So that I have a minimum feature set to ship
|
So that I have a minimum feature set to ship
|
||||||
|
|
||||||
Scenario: the glider
|
Scenario: the glider
|
||||||
|
|
||||||
Given the grid looks like
|
Given the grid looks like
|
||||||
...X..
|
...X..
|
||||||
..X...
|
..X...
|
||||||
..XXX.
|
..XXX.
|
||||||
......
|
......
|
||||||
......
|
......
|
||||||
When the next step occurs
|
When the next step occurs
|
||||||
Then the grid should look like
|
Then the grid should look like
|
||||||
......
|
......
|
||||||
..X.X.
|
..X.X.
|
||||||
..XX..
|
..XX..
|
||||||
...X..
|
...X..
|
||||||
......
|
......
|
||||||
When the next step occurs
|
When the next step occurs
|
||||||
Then the grid should look like
|
Then the grid should look like
|
||||||
......
|
......
|
||||||
..X...
|
..X...
|
||||||
..X.X.
|
..X.X.
|
||||||
..XX..
|
..XX..
|
||||||
......
|
......
|
||||||
When the next step occurs
|
When the next step occurs
|
||||||
Then the grid should look like
|
Then the grid should look like
|
||||||
......
|
......
|
||||||
...X..
|
...X..
|
||||||
.XX...
|
.XX...
|
||||||
..XX..
|
..XX..
|
||||||
......
|
......
|
||||||
When the next step occurs
|
When the next step occurs
|
||||||
Then the grid should look like
|
Then the grid should look like
|
||||||
......
|
......
|
||||||
..X...
|
..X...
|
||||||
.X....
|
.X....
|
||||||
.XXX..
|
.XXX..
|
||||||
......
|
......
|
||||||
|
|
|
||||||
|
|
@ -1,42 +1,42 @@
|
||||||
Story: I can create a cell
|
Story: I can create a cell
|
||||||
|
|
||||||
As a game producer
|
As a game producer
|
||||||
I want to create a cell
|
I want to create a cell
|
||||||
So that I can show the grid to people
|
So that I can show the grid to people
|
||||||
|
|
||||||
Scenario: nothing to see here
|
Scenario: nothing to see here
|
||||||
|
|
||||||
Given a 3 x 3 game
|
Given a 3 x 3 game
|
||||||
Then the grid should look like
|
Then the grid should look like
|
||||||
...
|
...
|
||||||
...
|
...
|
||||||
...
|
...
|
||||||
|
|
||||||
Scenario: all on its lonesome
|
Scenario: all on its lonesome
|
||||||
|
|
||||||
Given a 3 x 3 game
|
Given a 3 x 3 game
|
||||||
When I create a cell at 1, 1
|
When I create a cell at 1, 1
|
||||||
Then the grid should look like
|
Then the grid should look like
|
||||||
...
|
...
|
||||||
.X.
|
.X.
|
||||||
...
|
...
|
||||||
|
|
||||||
Scenario: the grid has three cells
|
Scenario: the grid has three cells
|
||||||
|
|
||||||
Given a 3 x 3 game
|
Given a 3 x 3 game
|
||||||
When I create a cell at 0, 0
|
When I create a cell at 0, 0
|
||||||
and I create a cell at 0, 1
|
and I create a cell at 0, 1
|
||||||
and I create a cell at 2, 2
|
and I create a cell at 2, 2
|
||||||
Then the grid should look like
|
Then the grid should look like
|
||||||
XX.
|
XX.
|
||||||
...
|
...
|
||||||
..X
|
..X
|
||||||
|
|
||||||
Scenario: more cells more more
|
Scenario: more cells more more
|
||||||
|
|
||||||
Given the grid has three cells
|
Given the grid has three cells
|
||||||
When I create a celll at 3, 1
|
When I create a celll at 3, 1
|
||||||
Then the grid should look like
|
Then the grid should look like
|
||||||
XX.
|
XX.
|
||||||
..X
|
..X
|
||||||
..X
|
..X
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
Story: I can kill a cell
|
Story: I can kill a cell
|
||||||
|
|
||||||
As a game producer
|
As a game producer
|
||||||
I want to kill a cell
|
I want to kill a cell
|
||||||
So that when I make a mistake I dont have to start again
|
So that when I make a mistake I dont have to start again
|
||||||
|
|
||||||
Scenario: bang youre dead
|
Scenario: bang youre dead
|
||||||
|
|
||||||
Given the grid looks like
|
Given the grid looks like
|
||||||
XX.
|
XX.
|
||||||
.X.
|
.X.
|
||||||
..X
|
..X
|
||||||
When I destroy the cell at 0, 1
|
When I destroy the cell at 0, 1
|
||||||
Then the grid should look like
|
Then the grid should look like
|
||||||
X..
|
X..
|
||||||
.X.
|
.X.
|
||||||
..X
|
..X
|
||||||
|
|
|
||||||
|
|
@ -1,53 +1,53 @@
|
||||||
Story: The grid wraps
|
Story: The grid wraps
|
||||||
|
|
||||||
As a game player
|
As a game player
|
||||||
I want the grid to wrap
|
I want the grid to wrap
|
||||||
So that untidy stuff at the edges is avoided
|
So that untidy stuff at the edges is avoided
|
||||||
|
|
||||||
Scenario: crowded in the corners
|
Scenario: crowded in the corners
|
||||||
|
|
||||||
Given the grid looks like
|
Given the grid looks like
|
||||||
X.X
|
X.X
|
||||||
...
|
...
|
||||||
X.X
|
X.X
|
||||||
When the next step is taken
|
When the next step is taken
|
||||||
Then the grid should look like
|
Then the grid should look like
|
||||||
X.X
|
X.X
|
||||||
...
|
...
|
||||||
X.X
|
X.X
|
||||||
|
|
||||||
|
|
||||||
Scenario: the glider returns
|
Scenario: the glider returns
|
||||||
|
|
||||||
Given the glider
|
Given the glider
|
||||||
......
|
......
|
||||||
..X...
|
..X...
|
||||||
.X....
|
.X....
|
||||||
.XXX..
|
.XXX..
|
||||||
......
|
......
|
||||||
When the next step is taken
|
When the next step is taken
|
||||||
and the next step is taken
|
and the next step is taken
|
||||||
and the next step is taken
|
and the next step is taken
|
||||||
and the next step is taken
|
and the next step is taken
|
||||||
Then the grid should look like
|
Then the grid should look like
|
||||||
......
|
......
|
||||||
......
|
......
|
||||||
.X....
|
.X....
|
||||||
X.....
|
X.....
|
||||||
XXX...
|
XXX...
|
||||||
When the next step is taken
|
When the next step is taken
|
||||||
Then the grid should look like
|
Then the grid should look like
|
||||||
.X....
|
.X....
|
||||||
......
|
......
|
||||||
......
|
......
|
||||||
X.X...
|
X.X...
|
||||||
XX....
|
XX....
|
||||||
When the next step is taken
|
When the next step is taken
|
||||||
Then the grid should look like
|
Then the grid should look like
|
||||||
XX....
|
XX....
|
||||||
......
|
......
|
||||||
......
|
......
|
||||||
X.....
|
X.....
|
||||||
X.X...
|
X.X...
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
44
vendor/plugins/rspec/lib/spec/version.rb
vendored
44
vendor/plugins/rspec/lib/spec/version.rb
vendored
|
|
@ -1,22 +1,22 @@
|
||||||
module Spec
|
module Spec
|
||||||
module VERSION
|
module VERSION
|
||||||
unless defined? MAJOR
|
unless defined? MAJOR
|
||||||
MAJOR = 1
|
MAJOR = 1
|
||||||
MINOR = 1
|
MINOR = 1
|
||||||
TINY = 4
|
TINY = 4
|
||||||
RELEASE_CANDIDATE = nil
|
RELEASE_CANDIDATE = nil
|
||||||
|
|
||||||
BUILD_TIME_UTC = 20080615141040
|
BUILD_TIME_UTC = 20080615141040
|
||||||
|
|
||||||
STRING = [MAJOR, MINOR, TINY].join('.')
|
STRING = [MAJOR, MINOR, TINY].join('.')
|
||||||
TAG = "REL_#{[MAJOR, MINOR, TINY, RELEASE_CANDIDATE].compact.join('_')}".upcase.gsub(/\.|-/, '_')
|
TAG = "REL_#{[MAJOR, MINOR, TINY, RELEASE_CANDIDATE].compact.join('_')}".upcase.gsub(/\.|-/, '_')
|
||||||
FULL_VERSION = "#{[MAJOR, MINOR, TINY, RELEASE_CANDIDATE].compact.join('.')} (build #{BUILD_TIME_UTC})"
|
FULL_VERSION = "#{[MAJOR, MINOR, TINY, RELEASE_CANDIDATE].compact.join('.')} (build #{BUILD_TIME_UTC})"
|
||||||
|
|
||||||
NAME = "RSpec"
|
NAME = "RSpec"
|
||||||
URL = "http://rspec.rubyforge.org/"
|
URL = "http://rspec.rubyforge.org/"
|
||||||
|
|
||||||
DESCRIPTION = "#{NAME}-#{FULL_VERSION} - BDD for Ruby\n#{URL}"
|
DESCRIPTION = "#{NAME}-#{FULL_VERSION} - BDD for Ruby\n#{URL}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue