Created
June 29, 2017 07:02
-
-
Save unixc3t/1b46ce16b3777acb1314e5c4a5fe0bc8 to your computer and use it in GitHub Desktop.
Create rspec rails plugin
This file contains 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
# http://stackoverflow.com/questions/8507798/rails-3-1-plugin-gem-dummy-test-app-rspec | |
# http://namick.tumblr.com/post/17663752365/how-to-create-a-gemified-plugin-with-rails-3-2-rspec | |
rails plugin new plugin_name --skip-test-unit --dummy-path=spec/dummy | |
cd plugin_name | |
# Add rspec-rails to gemspec dev deps | |
# s.add_development_dependency "rspec-rails" | |
bundle install | |
cd spec/dummy | |
ln -s ../../spec | |
rails generate rspec:install | |
cd - | |
# Edit spec/spec_helper.rb or spec/rails_helper.rb (depends) and change | |
# require File.expand_path("../../config/environment", __FILE__) | |
# to | |
# require File.expand_path("../dummy/config/environment", __FILE__) | |
# Check if it works | |
rspec |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment