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
// an example to replace `u` with `?`, click `Default mappings` to see how `u` works. | |
api.Hints.setCharacters = 'asdfghjklewio'; | |
// an example to remove mapkey `Ctrl-i` | |
api.iunmap(":"); | |
api.unmap('<Ctrl-i>'); | |
api.unmap('u'); | |
api.map('u', 'X'); | |
api.map('P', 'cc'); | |
api.map('gi', 'i'); | |
api.map('F', 'af'); |
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
#Model | |
@user.should have(1).error_on(:username) # Checks whether there is an error in username | |
@user.errors[:username].should include("can't be blank") # check for the error message | |
#Rendering | |
response.should render_template(:index) | |
#Redirecting | |
response.should redirect_to(movies_path) |
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
" An example for a vimrc file. | |
" | |
" Maintainer: Bram Moolenaar <[email protected]> | |
" Last change: 2011 Apr 15 | |
" | |
" To use it, copy it to | |
" for Unix and OS/2: ~/.vimrc | |
" for Amiga: s:.vimrc | |
" for MS-DOS and Win32: $VIM\_vimrc | |
" for OpenVMS: sys$login:.vimrc |
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
#coding: utf-8 | |
#別名メソッドに気をつけよう。 | |
#たとえば | |
#array.mapとarray.collectは同じメソッドです。 | |
#自己破壊メソッドはポインタ参照が変わらないため、変数bは変数aの内容を表示する。 | |
a = [1,2,3] | |
b = a | |
a.reverse! | |
p b |