Sha256: 2715382f5a54ab3d9433c0925b7a07cfeb67812e5d8c5ba44b616bbeaf7eda34

Contents?: true

Size: 987 Bytes

Versions: 13

Compression:

Stored size: 987 Bytes

Contents

shared_examples_for "a license matcher" do
  describe "#matches?" do
    context "when a license text template exists" do
      before do
        subject.class.stub(:license_text).and_return('AWESOME "FOO" LICENSE')
      end

      it "should return true if the body matches exactly" do
        subject.text = 'AWESOME "FOO" LICENSE'
        should be_matches
      end

      it "should return false if the body does not match at all" do
        subject.text = "hi"
        should_not be_matches
      end

      it "should return true if the body matches disregarding quote and new line differences" do
        subject.text = "AWESOME\n'FOO'\nLICENSE"
        should be_matches
      end
    end
  end

  describe "#license_text" do
    it "should always produce a license text" do
      subject.class.license_text.should_not be_nil, "No license text found for #{subject.class}! Add a license template to lib/templates named '#{subject.class.demodulized_name}.txt'"
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
license_finder-0.9.1-java spec/support/license_examples.rb
license_finder-0.9.1 spec/support/license_examples.rb
license_finder-0.9.0-java spec/support/license_examples.rb
license_finder-0.9.0 spec/support/license_examples.rb
license_finder-0.8.2-java spec/support/license_examples.rb
license_finder-0.8.2 spec/support/license_examples.rb
license_finder-0.8.1-java spec/support/license_examples.rb
license_finder-0.8.1 spec/support/license_examples.rb
license_finder-0.8.0-java spec/support/license_examples.rb
license_finder-0.8.0 spec/support/license_examples.rb
license_finder-0.7.3 spec/support/license_examples.rb
license_finder-0.7.1 spec/support/license_examples.rb
license_finder-0.7.0 spec/support/license_examples.rb