ChangeLog を書く際によく使われる英語をまとめました。
ほとんど引用です。
| #-*- coding: utf-8 -*- | |
| Plugin.create :gray_protected_users do | |
| UserConfig[:protected_users_background_color] ||= [0xcccc,0xcccc,0xcccc] | |
| filter_message_background_color do | mp, array | | |
| if mp.to_message.user[:protected] == true | |
| array = UserConfig[:protected_users_background_color] | |
| end | |
| [mp, array] | |
| end |
| # RSpec matcher for alias_method. | |
| # https://gist.github.com/1950961 | |
| # Usage: | |
| # | |
| # describe User do | |
| # it { should alias_from(:username).to(:email) } | |
| # end | |
| RSpec::Matchers.define :alias_from do |alias_method| |
cribbed from http://pastebin.com/xgzeAmBn
Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.
| # RSpec's subject method, both implicitly and explicitly set, is useful for | |
| # declaratively setting up the context of the object under test. If you provide a | |
| # class for your describe block, subject will implicitly be set to a new instance | |
| # of this class (with no arguments passed to the constructor). If you want | |
| # something more complex done, such as setting arguments, you can use the | |
| # explicit subject setter, which takes a block. | |
| describe Person do | |
| context "born 19 years ago" do | |
| subject { Person.new(:birthdate => 19.years.ago } | |
| it { should be_eligible_to_vote } |