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
after "deploy:update_code", "tag_last_deploy" | |
task :tag_last_deploy do | |
if rails_env == 'production' | |
set :timestamp, Time.now | |
set :tag_name, "deployed_to_#{rails_env}_#{timestamp.to_i}" | |
`git pull origin #{branch}` | |
`git tag -a -m "Tagging deploy to #{rails_env} at #{timestamp}" #{tag_name} origin/#{branch}` | |
`git push --tags` | |
puts "Tagged release with #{tag_name}." |
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
# COMMUNITY CHALLENGE | |
# | |
# How would you test this Quiz#problem method? Only two rules: | |
# | |
# 1. No mocks or stubs allowed. I'm looking for a other alternatives. | |
# Mocks can get messy in complex scenarios, and this is intended to | |
# be a high level test which executes all code. I don't think mocking | |
# would be a very clean solution anyway, but if you want to try it | |
# and prove me wrong feel free. | |
# |
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
# Example of how to test a module included into multiple models | |
require File.expand_path(File.join(File.dirname(__FILE__), "..", "spec_helper")) | |
describe Featurable do | |
class FeaturableObject | |
include Featurable | |
attr_accessor :sport, :featured_at | |