Sha256: 63d70154896aac55901d1c77eff8db21331d4416ebe7e5124fe4a9b0d9d7df76

Contents?: true

Size: 880 Bytes

Versions: 1

Compression:

Stored size: 880 Bytes

Contents

# -*- coding: utf-8 -*-
require "sixarm_ruby_string_replace_between"

describe String do

  describe "#replace_between" do

    describe "with targets that are strings" do

      it "find" do
        expect("foogoohoo".replace_between("xxx", "oo", "oo")).must_equal "fooxxxoohoo"
      end

    end

    describe "with targets that are strings, and an offset" do

      it "finds" do
        expect("foogoohoo".replace_between("xxx", "oo", "oo", 3)).must_equal "foogooxxxoo"
      end

    end

    describe "with targets that are regexps" do

      it "finds" do
        expect("foogoohoo".replace_between("xxx", /oo/, /oo/)).must_equal "fooxxxoohoo"
      end

    end

    describe "with a targets that are regexps, and an offset" do

      it "finds" do
        expect("foogoohoo".replace_between("xxx", /oo/, /oo/, 3)).must_equal "foogooxxxoo"
      end

    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sixarm_ruby_string_replace_between-1.0.0 test/sixarm_ruby_string_replace_between_test/string/replace_between_test.rb