Skip to content

Commit

Permalink
remove duplicate sources
Browse files Browse the repository at this point in the history
  • Loading branch information
razum2um committed Feb 5, 2015
1 parent d715462 commit f0de312
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/appraisal/gemfile.rb
Expand Up @@ -97,7 +97,7 @@ def gemspec(options = {})
protected

def source_entry
@sources.map { |source| "source #{source.inspect}" }.join("\n")
@sources.uniq.map { |source| "source #{source.inspect}" }.join("\n")
end

def ruby_version_entry
Expand Down
7 changes: 7 additions & 0 deletions spec/appraisal/gemfile_spec.rb
Expand Up @@ -17,6 +17,13 @@
expect(gemfile.to_s.strip).to eq %{source "one"\nsource "two"}
end

it "ignores duplicate sources" do
gemfile = Appraisal::Gemfile.new
gemfile.source "one"
gemfile.source "one"
expect(gemfile.to_s.strip).to eq %{source "one"}
end

it "preserves dependency order" do
gemfile = Appraisal::Gemfile.new
gemfile.gem "one"
Expand Down

0 comments on commit f0de312

Please sign in to comment.