Sha256: 8060376ac353cb2b38e44fc3e36456e98c6bf1cd500a02ec1a4b713c3cc80f82
Contents?: true
Size: 1.04 KB
Versions: 141
Compression:
Stored size: 1.04 KB
Contents
# frozen_string_literal: true require 'eac_ruby_utils/patches/string/delimited' ::RSpec.describe ::String do let(:instance) { 'A text with <b>content between</b> tags.' } { ['<b>', '</b>'] => { 'inner' => 'content between', 'without_inner' => 'A text with <b></b> tags.', 'outer' => '<b>content between</b>', 'without_outer' => 'A text with tags.' }, ['<b>', '</br>'] => { 'inner' => '', 'without_inner' => 'A text with <b>content between</b> tags.', 'outer' => '', 'without_outer' => 'A text with <b>content between</b> tags.' } }.each do |delimiters, expected_values| context "when delimiters are #{delimiters}" do let(:bdel) { delimiters[0] } let(:edel) { delimiters[1] } expected_values.each do |method_suffix, expected_value| method_name = "delimited_#{method_suffix}" it "#{method_name} should return \"#{expected_value}\"" do expect(instance.send(method_name, bdel, edel)).to eq(expected_value) end end end end end
Version data entries
141 entries across 141 versions & 3 rubygems