This gist will give you a quick insight on how you can write unit tests with rspec!
Mini-topics covered:
- Defining test cases
- Writing your own factory
- Mocking methods/classes
- Expected test results;
- Writing controller specs
- Before you do....
| <!--Developer's debug menu at bottom of index page--> | |
| <div id="accordion"> | |
| <div class="card"> | |
| <div class="card-header" id="headingOne"> | |
| <h5 class="mb-0"> | |
| <button class="btn btn-link" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne"> | |
| Developer Debug Menu (click to toggle) | |
| </button> | |
| </h5> | |
| </div> |
| #!/bin/bash | |
| # NAME: full-backup | |
| # PATH: $HOME/bin | |
| # DESC: Full system backup - must call with SUDO | |
| # DATE: July 16, 2017. Modified July 26, 2017. | |
| apt autoclean # reduces size of /var/cache/apt/archives |
| #!/usr/bin/env bash | |
| APPNAME=$(basename $0 | sed "s/\.sh$//") | |
| # ----------------------------------------------------------------------------- | |
| # Log functions | |
| # ----------------------------------------------------------------------------- | |
| fn_log_info() { echo "$APPNAME: $1"; } | |
| fn_log_warn() { echo "$APPNAME: [WARNING] $1" 1>&2; } |
This document is not written in any particular order. It is ordered in sections
Follow at your own risk!
| ### ZShell | |
| # Brian's Config for ZShell | |
| # Enable colors and change prompt: | |
| autoload -U colors && colors | |
| PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b " | |
| # History in cache directory: | |
| HISTSIZE=10000 | |
| SAVEHIST=10000 |
| # Simple script to install docker - you need to check some values to enable this to work | |
| sudo apt update | |
| sudo apt remove docker docker-engine docker.io | |
| sudo apt install docker.io # return Y to install | |
| sudo systemctl start docker | |
| sudo systemctl enable docker | |
| docker --version # Checks what docker version |
| curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - | |
| sudo apt install -y nodejs |
git clone https://username:mygithubpassword@github.com/username/project.git