Sha256: e12134293612a1fe63cd882acbf1248b3df1cf2975f3eb30854104a3f629a893

Contents?: true

Size: 1.43 KB

Versions: 3

Compression:

Stored size: 1.43 KB

Contents

# Polisher Core Extensions Specs
#
# Licensed under the MIT license
# Copyright (C) 2013-2014 Red Hat, Inc.

require 'spec_helper'
require 'polisher/core'

describe String do
  describe "#gem?" do
    context "string represents path to gem" do
      it "returns true" do
        "/foo/rails.gem".should be_gem
      end
    end

    context "string does not represent path to gem" do
      it "returns false" do
        "/foo/rails.gemspec".should_not be_gem
      end
    end
  end

  describe "#gemspec?" do
    context "string represents path to gemspec" do
      it "returns true" do
        "/foo/rails.gemspec".should be_gemspec
      end
    end

    context "string does not represent path to gemspec" do
      it "returns false" do
        "/foo/rails.gem".should_not be_gemspec
      end
    end
  end

  describe "#gemfile?" do
    context "string represents path to gemfile" do
      it "returns true" do
        "/foo/Gemfile".should be_gemfile
      end
    end

    context "string does not represent path to gemfile" do
      it "returns false" do
        "/foo/foobar".should_not be_gemfile
      end
    end
  end

  describe "unrpmize" do
    it "returns string with rpm macros removed/replaced" do
      "%doc ".unrpmize.should == ""
      "%{_bindir}".unrpmize.should == "bin"
    end
  end

  describe "#rpmize" do
    it "returns string with rpm macros swapped in" do
      "bin".rpmize.should == "%{_bindir}"
    end
  end
end # describe String

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
polisher-0.9.1 spec/core_spec.rb
polisher-0.8.1 spec/core_spec.rb
polisher-0.7.1 spec/core_spec.rb