Created
April 5, 2018 13:03
-
-
Save antoniosb/c11510e606231ebb34e6aa1f42f44442 to your computer and use it in GitHub Desktop.
Create rspec rails plugin
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
# 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