Sha256: fc1b4835cacde1462a722f11bea89f534fb933d9a2f5c2332bfd4cf7853dfb4a
Contents?: true
Size: 1.14 KB
Versions: 25
Compression:
Stored size: 1.14 KB
Contents
require 'spec_helper' require 'chef/sugar/core_extensions' describe String do describe '#satisfies?' do it 'includes the method' do expect(described_class).to be_method_defined(:satisfies?) end end describe '#satisfied_by?' do it 'includes the method' do expect(described_class).to be_method_defined(:satisfied_by?) end end describe '#flush' do context 'when given a single-line string' do it 'strips trailing whitespace' do string = <<-EOH This is a string EOH expect(string.flush).to eq('This is a string') end end context 'when given a multi-line string' do it 'removes the leading number of whitespaces' do string = <<-EOH def method "This is a string!" end EOH expect(string.flush).to eq(%Q(def method\n "This is a string!"\nend)) end it 'leaves a newline when given' do string = <<-EOH def method "This is a string!" end EOH expect(string.flush).to eq(%Q(def method\n "This is a string!"\nend\n)) end end end end
Version data entries
25 entries across 25 versions & 2 rubygems