Skip to content

Commit

Permalink
Add some description tests and remove superfluos description setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
voxik committed Apr 23, 2015
1 parent 23b0b23 commit 95f44d0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/gem2rpm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def Gem2Rpm.convert(fname, template=RUBYGEM_TEMPLATE, out=$stdout,
# Deprecate, kept just for backward compatibility.
format = Gem2Rpm::Format.new(package)
spec = Gem2Rpm::Specification.new(package.spec)
spec.description ||= spec.summary
config = Gem2Rpm::Configuration.instance.to_default
download_path = ""
unless local
Expand Down
19 changes: 19 additions & 0 deletions test/test_specification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,23 @@ def test_dependencies
assert_equal(['> 1.0'], @spec.dependencies.first.requirement)
end

def test_description_empty
assert_equal "\n", @spec.description
end

def test_description_add_dot_when_missing
@gemspec.description = "description"
assert_equal "description.\n", @spec.description

@gemspec.description = "description."
assert_equal "description.\n", @spec.description
end

def test_description_use_summary_when_empty
assert_empty @spec.description.strip

@gemspec.summary = "summary"
assert_equal "summary.\n", @spec.description
end

end

0 comments on commit 95f44d0

Please sign in to comment.