Sha256: 2f795bb0d8676f09037f8c341688d19c6c23fbb1b4e480f08913dacabcd8e17d

Contents?: true

Size: 902 Bytes

Versions: 126

Compression:

Stored size: 902 Bytes

Contents

require 'spec_helper'
require 'dpl/provider/npm'

describe DPL::Provider::NPM do
  subject :provider do
    described_class.new(DummyContext.new, :email => 'foo@blah.com', :api_key => 'test')
  end

  describe "#check_auth" do
    example do
      expect(provider).to receive(:setup_auth)
      expect(provider).to receive(:log).with("Authenticated with email foo@blah.com")
      provider.check_auth
    end
  end

  describe "#push_app" do
    example do
      expect(provider.context).to receive(:shell).with("npm publish")
      provider.push_app
    end
  end

  describe "#setup_auth" do
    example do
      f = double(:npmrc)
      expect(File).to receive(:open).with(File.expand_path(DPL::Provider::NPM::NPMRC_FILE)).and_return(f)
      expect(f).to receive(:puts).with("_auth = test")
      expect(f).to receive(:puts).with("email = foo@blah.com")
      provider.setup_auth
    end
  end
end

Version data entries

126 entries across 126 versions & 1 rubygems

Version Path
dpl-1.7.12.travis.784.4 spec/provider/npm.rb
dpl-1.7.12.travis.783.4 spec/provider/npm.rb
dpl-1.7.12.travis.774.4 spec/provider/npm.rb
dpl-1.7.12.travis.773.4 spec/provider/npm.rb
dpl-1.7.12.travis.766.4 spec/provider/npm.rb
dpl-1.7.12.travis.764.4 spec/provider/npm.rb
dpl-1.7.12.travis.763.4 spec/provider/npm.rb
dpl-1.7.12.travis.762.4 spec/provider/npm.rb
dpl-1.7.12.travis.748.4 spec/provider/npm.rb
dpl-1.7.12.travis.742.4 spec/provider/npm.rb
dpl-1.7.12.travis.734.4 spec/provider/npm.rb
dpl-1.7.11.travis.733.4 spec/provider/npm.rb
dpl-1.7.11 spec/provider/npm.rb
dpl-1.7.10 spec/provider/npm.rb
dpl-1.7.11.travis.726.4 spec/provider/npm.rb
dpl-1.7.10.travis.725.4 spec/provider/npm.rb
dpl-1.7.10.travis.701.4 spec/provider/npm.rb
dpl-1.7.10.travis.700.4 spec/provider/npm.rb
dpl-1.7.10.travis.699.1 spec/provider/npm.rb
dpl-1.7.10.travis.694.1 spec/provider/npm.rb