Created
June 16, 2013 15:09
-
-
Save Jamedjo/5792332 to your computer and use it in GitHub Desktop.
Sinatra with RSpec config,
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
ruby '2.0.0' | |
gem 'sinatra' | |
gem 'rspec' | |
gem 'rack-test' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'myapp' | |
require 'spec_helper' | |
set :environment, :test | |
describe 'The MyApp site' do | |
it "returns somthing on the root url" do | |
get '/' | |
last_response.should be_ok | |
expect(last_response.body).to include "html" | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require './myapp' | |
require 'rspec' | |
require 'rack/test' | |
def app | |
MyAppClassName | |
end | |
# This file was generated by the `rspec --init` command. Conventionally, all | |
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. | |
# Require this file using `require "spec_helper"` to ensure that it is only | |
# loaded once. | |
# | |
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration | |
RSpec.configure do |config| | |
config.include Rack::Test::Methods | |
config.treat_symbols_as_metadata_keys_with_true_values = true | |
config.run_all_when_everything_filtered = true | |
# config.filter_run :focus | |
# Run specs in random order to surface order dependencies. If you find an | |
# order dependency and want to debug it, you can fix the order by providing | |
# the seed, which is printed after each run. | |
# --seed 1234 | |
config.order = 'random' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rspec --init
config.include Rack::Test::Methods
, correct requires anddef app; MyApp; end
rspec