Add tests for language/python

This commit is contained in:
Jonathan Chang 2018-09-24 17:12:21 -04:00
parent 0fe273be5f
commit 3ce4caeb1a

View File

@ -1,6 +1,35 @@
require "language/python"
require "resource"
describe Language::Python, :needs_python do
describe "#major_minor_version" do
it "returns a Version for Python 2" do
expect(subject).to receive(:major_minor_version).and_return(Version)
subject.major_minor_version("python")
end
end
describe "#site_packages" do
it "gives a different location between PyPy and Python 2" do
expect(subject.site_packages("python")).not_to eql(subject.site_packages("pypy"))
end
end
describe "#homebrew_site_packages" do
it "returns the Homebrew site packages location" do
expect(subject).to receive(:site_packages).and_return(Pathname)
subject.site_packages("python")
end
end
describe "#user_site_packages" do
it "can determine user site packages location" do
expect(subject).to receive(:user_site_packages).and_return(Pathname)
subject.user_site_packages("python")
end
end
end
describe Language::Python::Virtualenv::Virtualenv do
subject { described_class.new(formula, dir, "python") }