Skip to content

Instantly share code, notes, and snippets.

View peteryates's full-sized avatar
🪶

Peter Yates peteryates

🪶
View GitHub Profile
# Original: https://gist.github.com/otaviomedeiros/1950961
# Updated for new RSpec syntax
RSpec::Matchers.define :alias_from do |alias_method|
match do |subject|
begin
subject.send(alias_method)
rescue NoMethodError
raise "expected alias_method from #{alias_method} to #{@original_method} but #{alias_method} is not defined"
end
@peteryates
peteryates / delegate_matcher.rb
Last active August 29, 2015 13:57 — forked from pcreux/delegate_matcher.rb
Updated to new RSpec syntax
# RSpec matcher to spec delegations.
#
# Usage:
#
# describe Post do
# it { expect(subject).to delegate(:title).to(:name) } # post.title => post.name
# it { expect(subject).to delegate(:month).to(:created_at) } # post.month => post.created_at
# it { expect(subject).to delegate(:author_name).to(:author, :name) } # post.author_name => post.author.name
# end
@peteryates
peteryates / mecab.spec
Created February 12, 2014 09:29 — forked from hylom/mecab.spec
%define name mecab
%define version 0.996
%define release el6.4
Summary: Yet Another Part-of-Speech and Morphological
Name: %{name}
Version: %{version}
Release: %{release}
Source0: https://mecab.googlecode.com/files/mecab-%{version}.tar.gz
License: GPL/LGPL/BSD
%define name mecab-ipadic
%define ver 2.7.0
%define date 20070801
%define release el6.4_1
Summary: IPA dictionary for MeCab
Summary(ja): MeCab用のIPA辞書
Name: %{name}
Version: %{ver}.%{date}
Release: %{release}