Skip to content

Commit

Permalink
Add Visual Basic fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Grim committed Aug 14, 2017
1 parent cf0bd2c commit fd89ae0
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 0 deletions.
24 changes: 24 additions & 0 deletions cf_spec/fixtures/vb_msbuild/Program.vb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Imports System.IO
Imports Microsoft.AspNetCore.Hosting
Imports Microsoft.AspNetCore.Builder

Namespace VBSample
Module Program
Sub Main(args As String())
Dim builder as new WebHostBuilder()
builder.UseKestrel()
builder.UseStartup(Of Startup)
builder.UseContentRoot(Directory.GetCurrentDirectory())
Dim host as IWebHost
host = builder.Build()
host.Run()
End Sub
End Module

Class Startup
Sub Configure(app as IApplicationBuilder)
app.UseDefaultFiles()
app.UseStaticFiles()
End Sub
End Class
End Namespace
18 changes: 18 additions & 0 deletions cf_spec/fixtures/vb_msbuild/VBSample.vbproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0-preview2-final" />
</ItemGroup>

<Target Name="AddWwwRoot" BeforeTargets="AssignTargetPaths" DependsOnTargets="BeforeBuild;BeforePublish">
<ItemGroup>
<Content Include="wwwroot\**" CopyToOutputDirectory="Always" />
</ItemGroup>
</Target>

</Project>
6 changes: 6 additions & 0 deletions cf_spec/fixtures/vb_msbuild/global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "2.0.0-preview2-006497"
}
}

1 change: 1 addition & 0 deletions cf_spec/fixtures/vb_msbuild/wwwroot/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<html><head><title>Sample ASP.NET Core application using Visual Basic</title></head><body><h1>Hello World!</h1></body></html>
34 changes: 34 additions & 0 deletions cf_spec/unit/buildpack/detect/detect_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -248,5 +248,39 @@
end
end
end

context 'when *.vbproj exists in sub-directory' do
before do
FileUtils.mkdir_p(File.join(dir, 'src', 'proj'))
File.open(File.join(dir, 'src', 'proj', 'app.vbproj'), 'w') { |f| f.write('a') }
end

context 'and .vb file exists in the same directory' do
before do
File.open(File.join(dir, 'src', 'proj', 'Program.vb'), 'w') { |f| f.write('a') }
end

it 'returns true' do
expect(subject.detect(dir)).to be_truthy
end
end

context 'and .vb file exists in a sub directory' do
before do
FileUtils.mkdir_p(File.join(dir, 'src', 'proj', 'sub'))
File.open(File.join(dir, 'src', 'proj', 'sub', 'Program.vb'), 'w') { |f| f.write('a') }
end

it 'returns true' do
expect(subject.detect(dir)).to be_truthy
end
end

context 'but no .vb file exists in the directory or sub directories' do
it 'returns false' do
expect(subject.detect(dir)).not_to be_truthy
end
end
end
end
end

0 comments on commit fd89ae0

Please sign in to comment.