LoginSignup
44
46

More than 5 years have passed since last update.

rake spec で spec/ 以下のテストを実行させるための最小限の設定

Last updated at Posted at 2013-02-09

のストック代わりにメモ。

Rakefile
require "rspec/core/rake_task"

RSpec::Core::RakeTask.new("spec")
task :default => :spec
spec/spec_helper.rb
require 'rspec'

Dir["./support/**/*.rb"].each do |f|
  require f
end

RSpec.configure do |config|
end
spec/app_spec.rb
require 'spec_helper'

describe 'app_spec' do
  it {
    expect(1).to eq(1)
  }
end
Gemfile
source 'https://rubygems.org/'

gem 'rake'
gem 'rspec'
$ rake spec
$ bundle exec rake spec
44
46
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
44
46