Skip to content

Instantly share code, notes, and snippets.

@dncrht
Created May 17, 2016 11:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dncrht/31b3ae37c19298506298dd4479bf66ba to your computer and use it in GitHub Desktop.
Save dncrht/31b3ae37c19298506298dd4479bf66ba to your computer and use it in GitHub Desktop.
Using strip_heredoc outside Rails
require 'spec_helper'
require 'active_support/core_ext/string/strip'
class MyClass
def call
"this is\na pretty\n(¯`·._.·[ string ]·._.·´¯)\n"
end
end
describe MyClass do
it 'returns the expected string' do
my = MyClass
expect(subject.call).to eq <<-eos.strip_heredoc
this is
a pretty
(¯`·._.·[ string ]·._.·´¯)
eos
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment