Skip to content

Commit 0494699

Browse files
committed
Merge pull request #67 from dominic/rails3
Add Rspec, Fabrication, Cucumber
2 parents c37ade3 + 4c82283 commit 0494699

29 files changed

Lines changed: 586 additions & 40 deletions

.rspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--colour

Gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,8 @@ gem 'jquery-rails'
2121
# Use unicorn as the web server
2222
gem 'unicorn'
2323

24+
group :development, :test do
25+
gem 'fabrication'
26+
gem 'rspec-rails'
27+
gem 'cucumber-rails'
28+
end

Gemfile.lock

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,48 @@ GEM
3535
bson (1.3.1)
3636
bson_ext (1.3.1)
3737
builder (3.0.0)
38+
capybara (1.0.1)
39+
mime-types (>= 1.16)
40+
nokogiri (>= 1.3.3)
41+
rack (>= 1.0.0)
42+
rack-test (>= 0.5.4)
43+
selenium-webdriver (~> 2.0)
44+
xpath (~> 0.1.4)
45+
childprocess (0.2.2)
46+
ffi (~> 1.0.6)
3847
coffee-rails (3.1.0.rc.6)
3948
coffee-script (>= 2.2.0)
4049
railties (~> 3.1.0.rc1)
4150
coffee-script (2.2.0)
4251
coffee-script-source
4352
execjs
4453
coffee-script-source (1.1.2)
54+
cucumber (1.0.2)
55+
builder (>= 2.1.2)
56+
diff-lcs (>= 1.1.2)
57+
gherkin (~> 2.4.5)
58+
json (>= 1.4.6)
59+
term-ansicolor (>= 1.0.5)
60+
cucumber-rails (1.0.2)
61+
capybara (>= 1.0.0)
62+
cucumber (~> 1.0.0)
63+
nokogiri (>= 1.4.6)
64+
diff-lcs (1.1.3)
4565
erubis (2.7.0)
4666
execjs (1.2.4)
4767
multi_json (~> 1.0)
68+
fabrication (1.1.0)
69+
ffi (1.0.9)
70+
gherkin (2.4.16)
71+
json (>= 1.4.6)
4872
haml (3.1.2)
4973
hike (1.2.1)
5074
i18n (0.6.0)
5175
jquery-rails (1.0.13)
5276
railties (~> 3.0)
5377
thor (~> 0.14)
5478
json (1.5.3)
79+
json_pure (1.5.3)
5580
kgio (2.6.0)
5681
mail (2.3.0)
5782
i18n (>= 0.4.0)
@@ -65,6 +90,7 @@ GEM
6590
activesupport (~> 3.0)
6691
plucky (~> 0.3.8)
6792
multi_json (1.0.3)
93+
nokogiri (1.5.0)
6894
plucky (0.3.8)
6995
mongo (~> 1.3)
7096
polyglot (0.3.2)
@@ -95,16 +121,36 @@ GEM
95121
raindrops (0.7.0)
96122
rake (0.9.2)
97123
rdoc (3.9.4)
124+
rspec (2.6.0)
125+
rspec-core (~> 2.6.0)
126+
rspec-expectations (~> 2.6.0)
127+
rspec-mocks (~> 2.6.0)
128+
rspec-core (2.6.4)
129+
rspec-expectations (2.6.0)
130+
diff-lcs (~> 1.1.2)
131+
rspec-mocks (2.6.0)
132+
rspec-rails (2.6.1)
133+
actionpack (~> 3.0)
134+
activesupport (~> 3.0)
135+
railties (~> 3.0)
136+
rspec (~> 2.6.0)
137+
rubyzip (0.9.4)
98138
sass (3.1.7)
99139
sass-rails (3.1.0.rc.6)
100140
actionpack (~> 3.1.0.rc6)
101141
railties (~> 3.1.0.rc6)
102142
sass (>= 3.1.4)
143+
selenium-webdriver (2.5.0)
144+
childprocess (>= 0.2.1)
145+
ffi (>= 1.0.7)
146+
json_pure
147+
rubyzip
103148
sprockets (2.0.0.beta.15)
104149
hike (~> 1.2)
105150
rack (~> 1.0)
106151
tilt (~> 1.1, != 1.3.0)
107152
sqlite3 (1.3.4)
153+
term-ansicolor (1.0.6)
108154
thor (0.14.6)
109155
tilt (1.3.3)
110156
treetop (1.4.10)
@@ -118,18 +164,23 @@ GEM
118164
kgio (~> 2.4)
119165
rack
120166
raindrops (~> 0.6)
167+
xpath (0.1.4)
168+
nokogiri (~> 1.3)
121169

122170
PLATFORMS
123171
ruby
124172

125173
DEPENDENCIES
126174
bson_ext
127175
coffee-rails (~> 3.1.0.rc)
176+
cucumber-rails
177+
fabrication
128178
haml
129179
jquery-rails
130180
json
131181
mongo_mapper
132182
rails (= 3.1.0.rc6)
183+
rspec-rails
133184
sass-rails (~> 3.1.0.rc)
134185
sqlite3
135186
uglifier

config/application.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
module HacketyHackCom
1313
class Application < Rails::Application
14-
config.autoload_paths += %W(lib)
14+
config.autoload_paths += %W(#{config.root}/lib)
1515

1616
config.encoding = "utf-8"
1717

@@ -23,8 +23,9 @@ class Application < Rails::Application
2323
g.template_engine :haml
2424

2525
# you can also specify a different test framework or ORM here
26-
# g.test_framework :rspec
27-
g.orm :mongo_mapper
26+
g.test_framework :rspec, :fixture => true
27+
g.fixture_replacement :fabrication
28+
g.orm :mongo_mapper
2829
end
2930
end
3031
end

config/cucumber.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<%
2+
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
3+
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
4+
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
5+
%>
6+
default: <%= std_opts %> features
7+
wip: --tags @wip:3 --wip features
8+
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip

config/database.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ development:
1212
# Warning: The database defined as "test" will be erased and
1313
# re-generated from your development database when you run "rake".
1414
# Do not set this db to the same as development or production.
15-
test:
15+
test: &test
1616
adapter: sqlite3
1717
database: db/test.sqlite3
1818
pool: 5
@@ -23,3 +23,6 @@ production:
2323
database: db/production.sqlite3
2424
pool: 5
2525
timeout: 5000
26+
27+
cucumber:
28+
<<: *test

db/schema.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# encoding: UTF-8
2+
# This file is auto-generated from the current state of the database. Instead
3+
# of editing this file, please use the migrations feature of Active Record to
4+
# incrementally modify your database, and then regenerate this schema definition.
5+
#
6+
# Note that this schema.rb definition is the authoritative source for your
7+
# database schema. If you need to create the application database on another
8+
# system, you should be using db:schema:load, not running all the migrations
9+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
10+
# you'll amass, the slower it'll run and the greater likelihood for issues).
11+
#
12+
# It's strongly recommended to check this file into your version control system.
13+
14+
ActiveRecord::Schema.define(:version => 0) do
15+
16+
end

0 commit comments

Comments
 (0)