summaryrefslogtreecommitdiff
path: root/spec/commands/viz_spec.rb
blob: cd77efc165ecc535d9534026bce54ecb9e9b1c20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
require "spec_helper"

describe "bundle viz", :ruby => "1.9.3", :if => Bundler.which("dot") do
  let(:graphviz_lib) do
    graphviz_glob = base_system_gems.join("gems/ruby-graphviz*/lib")
    Dir[graphviz_glob].first
  end

  it "graphs gems from the Gemfile" do
    install_gemfile <<-G
      source "file://#{gem_repo1}"
      gem "rack"
      gem "rack-obama"
    G

    bundle "viz", :env => {"RUBYOPT" => "-I #{graphviz_lib}"}
    expect(out).to include("gem_graph.png")
  end

  it "graphs gems that are prereleases" do
    update_repo(gem_repo1) do
      build_gem "rack", "1.3.pre"
    end

    install_gemfile <<-G
      source "file://#{gem_repo1}"
      gem "rack", "= 1.3.pre"
      gem "rack-obama"
    G

    bundle "viz", :env => {"RUBYOPT" => "-I #{graphviz_lib}"}
    expect(out).to include("gem_graph.png")
  end
end