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
# language : ko | |
#UI관련 태스팅에 자주보이는 패턴. | |
#사실은 어떤 화면에 가는것도 유저 액션이니까 조건(Given)보단 만일(When)이 적절하다. | |
기능: UI안티패턴 | |
좋은 태스트 코드를 쓰기 위해 | |
프로그래머로써 | |
공부한다. |
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
기능: 로그인 | |
시스템의 기능들을 이용하기 위해 | |
사용자로써 | |
로그인 하고싶다 | |
배경: | |
조건 "사용자"님은 로그인상태입니다 | |
# 시나리오들.. |
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
Given /^"([^"]+)"님은 로그인상태입니다$/ do |name| | |
user = User.new(:login => "test123", :name => "사용자", :email => "[email protected]", :password => "test123", :password_confirmation => "test123", :role_id => 3, :state => "active") | |
user.create! | |
user.register! | |
user.activate! | |
visit '/login' | |
fill_in("login", :with => "test123") | |
fill_in("password", :with => "test123") | |
click_button "Log-in" | |
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
Given /^"([^"]+)"님은 로그인상태입니다$/ do |name| | |
$name = name | |
class ApplicationController | |
def current_user | |
session[:name] = $name | |
end | |
end | |
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
# file use | |
du -sh | |
# filesystem use rate | |
df -h |
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
Article.find([*1..10], :conditions => { :view => true }) |
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
#2.3 | |
Article.find_all_by_id_and_view(1..10, true) | |
#3.x | |
Article.where(:id => 1..10, :view => true).all |
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
Article.find(:conditions => { :id => [*1..10], :view => true }) |
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 'rubygems' | |
require 'wirble' | |
require 'ap' | |
require 'pp' | |
Wirble.init | |
Wirble.colorize | |
alias q exit |
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
- (CalculatorBrain *)brain | |
{ | |
if (!brain) { | |
brain = [[CalculatorBrain alloc] init]; | |
} | |
return brain; | |
} |
OlderNewer