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
# IMPT: | |
# Configure ENV['LOG_LEVEL'] to be one of DEBUG, INFO, WARN, ERROR, FATAL | |
# figure out where we are being loaded from | |
if $LOADED_FEATURES.grep(/spec\/spec_helper\.rb/).any? | |
begin | |
raise "foo" | |
rescue => e | |
puts <<-MSG | |
=================================================== |
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://soupmatt.com/fixing-bundlewithout-on-heroku-cedar | |
# Hack to make heroku work. Works b/c on heroku, the ENV['HOME'] will be 'app' | |
# and this will then return test, which heroku knows to exclude | |
def hg(g) | |
(ENV['HOME'].gsub('/', '') == 'app' ? 'test' : g) | |
end | |
group :test, hg(:ci) do | |
gem 'simplecov', require: false |
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
RSpec.configure do |config| | |
config.add_setting(:seed_tables) | |
config.seed_tables = %w(seed_table_1 seed_table_2) | |
config.before(:suite) do | |
DatabaseCleaner.clean_with(:truncation, except: config.seed_tables) | |
end | |
config.before(:each) do | |
DatabaseCleaner.strategy = :transaction |
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
def fill_in_autocomplete(selector, value) | |
script = %Q{ $('#{selector}').val('#{value}').focus().keypress() } | |
page.execute_script(script) | |
end | |
def choose_autocomplete(text) | |
expect(page).to have_css(".tt-suggestion p", text: text, visible: false) | |
script = %Q{ $('.tt-suggestion:contains("#{text}")').click() } | |
page.execute_script(script) | |
end |
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
group :spec do | |
guard('rspec', all_on_start: false, | |
all_after_pass: false, | |
run_all: { parallel: true, parallel_cli: '-n 4' }, | |
cmd: 'zeus rspec', | |
notification: true, | |
failed_mode: :keep) do | |
watch(%r{^spec/.+_spec\.rb$}) | |
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } | |
watch("spec/spec_helper.rb") { "spec" } |
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
--color | |
--require spec_helper | |
--require rspec/instafail | |
--format RSpec::Instafail | |
--backtrace | |
--format documentation |
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
def run_command_raise_if_error(command) | |
puts "Executing: #{command}" | |
result = %x[#{command}] | |
raise "rake task failed..........\n#{result}" if result.include?('rake aborted!') | |
end | |
def run_rake_command_raise_if_error(command) | |
run_command_raise_if_error("bundle exec rake #{command}") | |
end |
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
# First brew install tmux, gem install tmuxinator, and download item2 | |
# Copy this file here: ~/.tmuxinator/my_project.yml | |
# Modify the paths (replace ~/my_project with your directory) | |
# Invoke with | |
# mux project | |
# Then hit 'Ctrl-a d' to detach | |
# Then run 'tmux -CC attach' | |
# Make sure that option for iterm2 is General --> tmux --> When attaching, open unrecognized windows in Tabs | |
# Also, check option "Automatically hide the tmux client session after connecting" | |
# alias beg='bundle exec guard' |
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
// Run like this | |
// cd webpack && webpack -w --config webpack.rails.config.js | |
var path = require("path"); | |
var railsBundleFile = "rails-bundle.js"; | |
var railsJsAssetsDir = "../app/assets/javascripts"; | |
var railsBundleMapFile = railsBundleFile + ".map"; | |
var railsBundleMapRelativePath = "../../../public/assets/" + railsBundleMapFile; | |
module.exports = { |
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
var webpack = require("webpack"); | |
var path = require("path"); | |
module.exports = { | |
devtool: "source-map", | |
context: __dirname, // + "/../app/assets/javascripts", | |
entry: [ | |
"webpack-dev-server/client?http://localhost:3000", | |
"webpack/hot/dev-server", | |
"./scripts/webpack_only", |
OlderNewer