You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
translations Documentation RSpec is a great tool in the behavior-driven development (BDD) process of writing human readable specifications that direct and validate the development of your application. On the web there are many resources that give complete overview of _what_ you can do with RSpec. But there are fewer resources devoted to how to create a great RSpec test suite. Better Specs tries to
ã¯ãã㫠以åããä½åº¦ãç´¹ä»ãã¦ããRSpecæ¬ã®ç¿»è¨³ãçµäºããã¤ãã«è²©å£²ãéå§ãã¾ããï¼ æä¾ãã©ã¼ãããã¯MOBI(Kindle)ãEPUB(iBooks)ãPDFã§ãä¸è¨ã®ãã¼ã¸ããè³¼å ¥ã§ãã¾ãã Everyday Rails - RSpecã«ããRailsãã¹ãå ¥é - Leanpub ä»åã¯æ¹ãã¦ãã®æ¬ã®ç´¹ä»ãæ¸ãã¦ã¿ããã¨æãã¾ãã ãEveryday Rails - RSpecã«ããRailsãã¹ãå ¥éãã£ã¦ã©ããªæ¬ï¼ ãEveryday Rails - RSpecã«ããRailsãã¹ãå ¥é ï½ãã¹ãé§åéçºã®ç¿å¾ã«åããå®è·µçã¢ããã¼ãï½ãã¯ã¿ã¤ãã«ã®éããRSpecã使ã£ãRailsã®èªåãã¹ãã説æããæè¡æ¸ã§ãã å 容ã¨ãã¦ã¯æ¯è¼çæããã§ãããã¾ã§é«åº¦ãªè©±é¡ã¯åºã¦ãã¾ããããªã®ã§RSpecã®æªçµé¨è ï½ä¸ç´è ãã¤ãRailsã使ã£ã¦éçºãã¦ããæè¡è ãã¿ã¼ã²ãã層ã«ãª
There are a few things motivating this new syntax, and I wanted to blog about it to spread awareness. Delegation Issues Between method_missing, BasicObject and the standard libraryâs delegate, ruby has very rich tools for building delegate or proxy objects. Unfortunately, RSpecâs should syntax, as elegantly as it reads, is prone to producing weird, confusing failures when testing delegate/proxy ob
[Sitespec](https://github.com/r7kamura/sitespec)ã¨ããéçãµã¤ãçæãã¼ã«ãä½ãããã®ããã°ã移è¡ããã ## Sitespec Sitespecã¯ãWebã¢ããªã¨ãã¹ãããéçãµã¤ããçæããããã®ãã¼ã«ã Webã¢ããªã«ã¯Rackãããã¹ãã«ã¯RSpecã使ãã Rackã使ã£ãé©å½ãªWebã¢ããªãç¨æãã RSpecã§HTTPãªã¯ã¨ã¹ããçºè¡ããããã«è¨è¿°ãããã¹ããå®è¡ããã¨ã ã¬ã¹ãã³ã¹ã®å 容ããéçãã¡ã¤ã«ãçæãããã¨ããä»çµã¿ã«ãªã£ã¦ããã åèã¾ã§ã«ç´¹ä»ãã¦ããã¨ãéçãµã¤ãçæãã¼ã«ã«ã¯ä»ã« [Middleman](http://middlemanapp.com/)ã[Octopress](http://octopress.org/)ã[Movable Type](http://www.movabletype.jp/) ãª
RSpec is a Behaviour-Driven Development tool for Ruby programmers. BDD is an approach to software development that combines Test-Driven Development, Domain Driven Design, and Acceptance Test-Driven Planning. RSpec helps you do the TDD part of that equation, focusing on the documentation and design aspects of TDD. Documentation This is the official documentation site for RSpec. Much of the document
åç° å人(@t_wada) ä½ãRSpec ã®å ¥éã¨ãã®ä¸æ©å ã¸ã第2ã¤ãã¬ã¼ã·ã§ã³ãã¯ã¯ãªã¨ã¤ãã£ãã»ã³ã¢ã³ãº 表示 - ç¶æ¿ 4.0 å½é ã©ã¤ã»ã³ã¹ã§æä¾ããã¦ãã¾ãã #coffee.rb ã®åçµä¼ã«æããã(ã¨ããããã¯æ¼ãããã?)ã®ã§ãå æ¥ã® RSpec ãã¥ã¼ããªã¢ã«ã®ç¶ããè¨ãã¾ãããã®ã¨ã³ããªã¯åçµä¼ã«åå ããªããã®ã©ã¤ãæ´æ°ã§ããã (æ´æ°) 第3ã¤ãã¬ã¼ã·ã§ã³ãæ¸ãã¾ãããç¶ãã«èå³ããæ¹ã¯ã覧ä¸ãã ååçµäºæç¹ã®ã³ã¼ãã¨å®è¡çµæ ååçµäºæç¹ã§ã®ã³ã¼ãã以ä¸ã«è¨ãã¾ãã message_filter.rb class MessageFilter def initialize(word) @word = word end def detect?(text) text.include?(@word) end end message_filter_spec.rb r
ãã®ã¦ã§ããµã¤ãã¯è²©å£²ç¨ã§ãï¼ twiwt.org ã¯ãããªãããæ¢ãã®æ å ±ã®å ¨ã¦ã®ææ°ãã¤æé©ãªã½ã¼ã¹ã§ããä¸è¬ãããã¯ããããããæ¤ç´¢ã§ããå 容ã¯ãtwiwt.orgãå ¨ã¦ã¨ãªãã¾ããããªãããæ¢ãã®å 容ãè¦ã¤ãããã¨ãé¡ã£ã¦ãã¾ãï¼
æ°ç±³ã¨ç§åéã®ããç¼ã ãåºèº«ç¨ã®ç§åéãè²·ãã¾ããã1å°¾250åã§ã 3æã«ãããã¦ãç§åéã®ããã«é ãå³éãé¤æ²¹ã§èª¿å³ãã¦1æéã»ã©æ¼¬ãè¾¼ã¿ãã°ãªã«ã§ç¼ãã¾ãã ç§åéã®ããç¼ã ããã®ãè¦å³ãç¨ãããã¤ã«ãã«èª¿å³ãããã¯ã»ã«ãªãå³ããã§ã è¶ãããªæ°ç±³ã¨ä¸ç·ã« èªå®¶è£½ãæ¼¬ç© åâ¦
RSpecã§ä½¿ãåºæ¬ã¡ã½ãã(describe/context/it/its/before/after/subject/let/shared_examples_for)ãã¾ã¨ãã¦ã¿ãã åèãªã³ã¯ RSpec - æ¬è¨äºã¯ããã®ã»ã¼æç²ã§ããããã¾ã¨ã¾ã£ã¦ãã¾ã RSpec ã使ãå§ãã人ãèªãã¹ã N åã®ããã¥ã¡ã³ã | Aiming éçºè ããã° - åèãªã³ã¯ããã£ã±ãããã¾ããä¸ã®è¨äºãããã§è¦ã¤ãã describe/context - ãã¹ãåããã¹ã対象èªèº«ã®ãªãã¸ã§ã¯ã(subject代ãã)ã§ãOK before - äºåæ¡ä»¶ãexample(it)ã®åã«å®è¡ããããbefore :each ã¯exampleæ¯ãbefore :all ã¯describeæ¯ã«å¼ã°ãã after - äºå¾å¦çã以å¾ã®ãã¹ãã«å½±é¿ãåºãªãããã«å¾å§æ«ãå¿ è¦ãªæã«è¨è¿°ãã subject -
Ruby,Rubygems,MongoDBã¯ã¤ã³ã¹ãã¼ã«ããã¦ãããã®ã¨ãã MongoDBã®ã¤ã³ã¹ãã¼ã«ã«ã¤ãã¦ã¯CentOSã§ããã°åã«ã¡ãã£ã¨æ¸ãã éå»ã®è¨äºï¼CentOS5.5ã«MongoDBãã¤ã³ã¹ãã¼ã«ãã - chulip.org ã¤ã³ã¹ãã¼ã« Bundlerã使ç¨ãã¦å¿ è¦ãªGemãã¤ã³ã¹ãã¼ã«ããã ãªãMongoDBã®ORMã¨ãã¦Mongoidã使ç¨ãã $ gem install bundlerGemfile source :rubygems gem 'sinatra' gem 'mongoid' gem 'bson_ext' gem 'SystemTimer' #1.8.7ã ãå¿ è¦ã ã£ãã½ã group :test do gem 'rspec' gem 'rack-test' end$ bundle install bson_extã¨SystemTimer bson
rspec-system provides a framework for creating system tests using the rspec testing library. The goal here is to provide facilities to aid in the launching of tests nodes, copying of test content to such nodes, and executing commands on such nodes to be tested with standard rspec assertions within the standard rspec test format. Note: This library is fairly new at the moment, so your mileage may v
ã¡ãã£ã¨åã«è©±é¡ã«ãªã£ãRSpecã®ã¹ã©ã¤ããã¹ããã ã£ããããã§ãRSpecã¯ã¾ã ã¾ã åºç¥ããªãæ°ãããã®ã§èªåã§ãããããã¨èª¿ã¹ã¦ã¿ããã¨æã£ã次第ã ã¾ãã¯rspec-core(2.5.1)/features/example_groups/shared_example_group.featureãåèã«shared example groupã«ã¤ãã¦èª¿ã¹ã¦ã¿ããã ä¾ï¼ï¼ãã¹ããå ±æã§ãã require "set" shared_examples_for 'a collection' do subject { described_class.new [7, 2, 4] } its(:size) { should eq 3 } it { should include 7 } it { should_not include 9 } end describe Array do it_be
以åæ¸ãããã®ã®ç¶ãã§ãã é¡åã®éãsinatraã§rspecã使ãåºæ¬çãªãã¨ããã«ãªãã¾ãã sinatraã ãã®è¨å®ãèããã¨test/unitã¨åãã§ããä¹±æ´ã«è¨ãã¨assertãshouldã«ãªãã ãã ã¨æã£ã¦ããã¨æãã¾ãã ãµã³ãã«ã³ã¼ã ååã®ãµã³ãã«ã³ã¼ããrspecã§æ¸ãã require './hello_world' require 'rspec' require 'rack/test' set :environment, :test describe 'The HelloWorld App' do include Rack::Test::Methods def app Sinatra::Application end it "says hello" do get '/' last_response.should be_ok last_response.body.
Testing Sinatra with Rack::Test All examples in the following sections assume that Test::Unit is being used in an attempt to be as general as possible. See the Test Framework Examples for information on using the test helpers in other testing environments. To use the Rack::Test library used when you require rack/test, youâll need to install the rack-test gem:
ãsinatraããã¼ãã£ã¦ä»ããæããsinatraã§ä½ãä½ã£ã¦ã¿ããããã¼ã¨æããå½ç¶ãã¹ãã®ãã¨ãæ°ã«ãªãã¾ããã ããããããã¹ãåºæ¥ãã®ï¼å®ã¯railsã¨æ¯ã¹ã¦å¤§å¤ãããªãã®ï¼ï¼ï¼ãã£ã¦æãã®ã¢ããªä¸å®ã§ããã(1é±éåã¾ã§sinatraã®ãã¨ã¨è¨ãã°ååãããããªãã£ãã®ã§ãã)ãã¹ãã«ã¤ãã¦ã¯ã¡ããã¨å ¬å¼ãã¼ã¸ã§è§£èª¬ããã¦ãã¾ããrspecã使ãã¾ããcapybaraã使ãã¾ããä»ã®ãã¹ããã¬ã¼ã ã¯ã¼ã¯ã使ããããã§ãã åèãã¼ã¸ã¯ Testing Sinatra with Rack::Test ã§ããããã®å 容ãç解ãã¦ããã¾ãã ãµã³ãã«ã³ã¼ã ãã¹ã対象ã®ã³ã¼ãããã¤ãã®hello worldã require 'sinatra' get '/' do "Hello World #{params[:name]}".strip end ãã¹ãã³ã¼ã require '.
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}