I hereby claim:
- I am wlangstroth on github.
- I am wlangstroth (https://keybase.io/wlangstroth) on keybase.
- I have a public key whose fingerprint is E2F2 215B AA83 1547 A87E E85F 69DF E208 FA87 7968
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| require_relative '../test_helper' | |
| class ThingsControllerTest < ActionController::TestCase | |
| setup do | |
| @thing = things(:default) | |
| end | |
| def test_index | |
| things = [things(:default)] |
| require_relative '../test_helper' | |
| class ThingTest < ActiveSupport::TestCase | |
| def test_fixtures | |
| Thing.all.each do |thing| | |
| assert thing.valid?, thing.errors.inspect | |
| end | |
| end |
| class Thing < ActiveRecord::Base | |
| # == Constants ========================================================== | |
| CONSTANTS = %w[ thing1 thing2 ] | |
| # == Attributes ========================================================= | |
| attr_accessor :attribute |
| class ThingsController < ActiveController | |
| before_action :build_thing, only: [:new, :create] | |
| before_action :load_thing, only: [:show, :edit, :update, :destroy] | |
| def index | |
| @thing = Thing.page(params[:page]) | |
| end | |
| def show | |
| render |
| require "minitest_helper" | |
| class RuleTest < MiniTest::Unit::TestCase | |
| def setup | |
| end | |
| def teardown | |
| end | |
| def test_stuff |
| class Rule | |
| def self.setters(*method_names) | |
| method_names.each do |name| | |
| send :define_method, name do |data| | |
| instance_variable_set "@#{name}".to_sym, data. | |
| end | |
| end | |
| end | |
| # test/minitest_helper.rb | |
| require "turn/autorun" | |
| require "minitest/spec" | |
| require "minitest/autorun" | |
| Turn.config do |c| | |
| c.format = :pretty | |
| end |
| require 'rake/testtask' | |
| Rake::TestTask.new do |t| | |
| t.libs << "lib" | |
| t.libs << "test" | |
| t.pattern = "test/*_test.rb" | |
| end |
| cat a b | sort | uniq > c # c is a union b | |
| cat a b | sort | uniq -d > c # c is a intersect b | |
| cat a b b | sort | uniq -u > c # c is set difference a - b | |
| find . -type f -ls | |
| find . -name \*.py | xargs grep some_function | |
| cat hosts | xargs -I{} ssh root@{} hostname | |
| cat access.log | egrep -o 'acct_id=[0-9]+' | cut -d= -f2 | sort | uniq -c | sort -rn |