How do you compare date/times in RSpec?
If you do this
expect(Time.now.to_i).to eq Time.new(2014, 4, 2).to_i
#!/usr/bin/env bash | |
sudo locale-gen en_US.UTF-8 | |
sudo update-locale LANG=en_US.UTF-8 | |
sudo update-locale LC_ALL=en_US.UTF-8 | |
sudo apt-get update | |
sudo apt-get install -y build-essential git curl libxslt1-dev libxml2-dev libssl-dev | |
# postgres |
ssh_options[:forward_agent] = true | |
default_run_options[:pty] = true | |
## | |
## available environments | |
## | |
task :production do | |
set :application, 'myapp.com' | |
set :repository, 'https://github.com/user/project.git' |
This list is based on aliases_spec.rb.
You can see also Module: RSpec::Matchers API.
matcher | aliased to | description |
---|---|---|
a_truthy_value | be_truthy | a truthy value |
a_falsey_value | be_falsey | a falsey value |
be_falsy | be_falsey | be falsy |
a_falsy_value | be_falsey | a falsy value |
#login | |
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d ' {"user":{"email":"<email>","password":"<passwd>"}}' http://localhost:3000/api/v1/sign_in.json | |
#logout | |
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X DELETE http://localhost:3000/api/v1/sign_out.json?auth_token=<token> |
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
require 'bundler' | |
Bundler.setup(:default) | |
require 'active_record' | |
require 'minitest/autorun' | |
require 'logger' |
config.assets.precompile += [ | |
# precompile any CSS or JS file that doesn't start with _ | |
/(^inline[^_\/]|\/[^_])[^\/]*.(js|css)$/, | |
... |
quick hack to explore auto-saving on lint-free code
Using SublimeLint3
Sublime Text -> Preferences -> Browser Packages
Open sublimelinter.py
in Sublime.
Seek to the highlight
method (Cmd + R
)
replace with function (see below)
module I18n | |
module Backend | |
class Simple | |
module Implementation | |
alias_method :lookup_orig, :lookup | |
# Give ability to check I18n looked up keys in lazy mode by setting env var I18N_DEBUG to true | |
# | |
def lookup(locale, key, scope = [], options = {}) | |
puts "I18N keys: #{I18n.normalize_keys(locale, key, scope, options[:separator])}" if ENV['I18N_DEBUG'] |
* { | |
font-size: 12pt; | |
font-family: monospace; | |
font-weight: normal; | |
font-style: normal; | |
text-decoration: none; | |
color: black; | |
cursor: default; | |
} |