diff options
| -rw-r--r-- | lib/spandx/ruby/index.rb | 3 | ||||
| -rw-r--r-- | spec/unit/cli/build_spec.rb | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/spandx/ruby/index.rb b/lib/spandx/ruby/index.rb index e573468..01152a5 100644 --- a/lib/spandx/ruby/index.rb +++ b/lib/spandx/ruby/index.rb @@ -9,7 +9,8 @@ module Spandx def initialize(directory:) @directory = directory - @cache = ::Spandx::Core::Cache.new('rubygems', root: directory) + @name = 'rubygems' + @cache = ::Spandx::Core::Cache.new(@name, root: directory) @rubygems = ::Spandx::Ruby::Gateway.new end diff --git a/spec/unit/cli/build_spec.rb b/spec/unit/cli/build_spec.rb index 0756ffc..f2c6a1f 100644 --- a/spec/unit/cli/build_spec.rb +++ b/spec/unit/cli/build_spec.rb @@ -18,8 +18,11 @@ RSpec.describe Spandx::Cli::Commands::Build do stub_request(:get, 'https://pypi.org/simple/') .to_return(status: 200, body: '<html></html>') + stub_request(:get, 'https://index.rubygems.org/versions') + .to_return(status: 200, body: "created_at: 2020-12-01T00:00:35+00:00\n---\n") + subject.execute(output: output) - expect(output.string).to eq("nuget\nmaven\npypi\nOK\n") + expect(output.string).to eq("nuget\nmaven\npypi\nrubygems\nOK\n") end end end |
