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
class Estimate < ApplicationRecord | |
def accept! | |
# update db | |
end | |
def reject! | |
# update db | |
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
# frozen_string_literal: true | |
source "https://rubygems.org" | |
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } | |
gem 'rake' | |
gem 'minitest' | |
gem 'minitest-reporters' |
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
# Editor temporary files | |
# | |
*~ | |
\#*\# | |
.\#* | |
*.swp | |
*.swo | |
*.sublime-project | |
*.sublime-workspace |
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
source 'https://rubygems.org' | |
git_source(:github) do |repo_name| | |
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") | |
"https://github.com/#{repo_name}.git" | |
end | |
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
gem 'rails', '~> 5.1.4' |
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
require 'rake/testtask' | |
Rake::TestTask.new(:test) do |t| | |
t.libs = %w(lib test) | |
t.pattern = 'test/**/*_test.rb' | |
t.options = '-v' | |
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
# EINSTEIN'S RIDDLE | |
# | |
# There are five houses in five different colours in a row. In each house lives | |
# a person with a different nationality. The five owners drink a certain type of | |
# beverage, smoke a certain brand of cigar and keep a certain pet. | |
# | |
# No owners have the same pet, smoke the same brand of cigar, or drink the same | |
# beverage. | |
# | |
# Other facts: |
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
require "minitest/autorun" | |
class MinitestMockTest < Minitest::Test | |
def test_method_called_more_times_than_expected | |
mock = Minitest::Mock.new | |
3.times { mock.expect :some_method, true } | |
assert mock.some_method # OK | |
assert mock.some_method # OK | |
assert mock.some_method # still OK |
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
Sample code that shows how to use Minitest::Benchmark in a semi-realistic way |
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
# Emacs temporary files | |
*~ | |
\#*\# | |
# Bundler artifacts | |
.bundle | |
vendor/bundle | |
# Database configuration, files | |
config/database.yml |
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
set :application, 'Example' # the name of your app | |
set :location, 'example.com' # server address | |
set :user, 'deploy' # remote user (unprivileged deployment user) | |
set :group, 'www-data' # remote group (should be the group your web server runs as) | |
set :use_sudo, false | |
set :scm, 'none' | |
set :deploy_via, :copy | |
set :repository, '.' | |
set :deploy_to, '/var/www/example' |
NewerOlder