Skip to content

Instantly share code, notes, and snippets.

@halostatue
halostatue / json_body_matcher.rb
Created October 29, 2014 01:08
expect(response).to be_json_for Object
module ContentTypeMatchers
extend RSpec::Matchers::DSL
matcher :be_content_type do |expected|
match do |actual|
expect(actual.content_type).to eq(expected)
end
failure_message_for_should do |actual|
%Q(expected that response content type "#{actual.header['Content-Type']}" would be "#{expected}")
@kevinjalbert
kevinjalbert / readme.md
Last active December 31, 2021 03:49
Project-Wide Search and Replace with Vim

Project-Wide Search and Replace with Vim

There are many instances where you might want to perform a mass search and replace in Vim. The following are two commands that can help out with such a task.

List of Files

First you need to acquire a list of files in which you want to perform search and replaces on. The following Vim command args allows you to store a set of file names to act on later.

:args `<command which generates a file list>`

Thus we can use the following to store a list of files which match the 'Base::Lol::' . pattern.