see if I can get travis to work
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -9,7 +9,8 @@
|
|||||||
*.DotSettings
|
*.DotSettings
|
||||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||||
*.userprefs
|
*.userprefs
|
||||||
|
*.lock
|
||||||
|
tools/
|
||||||
**/.settings
|
**/.settings
|
||||||
NDependOut
|
NDependOut
|
||||||
*.ndproj
|
*.ndproj
|
||||||
|
|||||||
13
.travis.yml
Normal file
13
.travis.yml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
language: ruby
|
||||||
|
install:
|
||||||
|
- sudo apt-get update
|
||||||
|
- sudo apt-get install puppet
|
||||||
|
- puppet module install puppetlabs-apt
|
||||||
|
- puppet apply assets/puppet/site.pp
|
||||||
|
- bundle
|
||||||
|
script:
|
||||||
|
- bundle exec rake preflight
|
||||||
|
notifications:
|
||||||
|
email:
|
||||||
|
- tparnell8@gmail.com
|
||||||
|
gemfile: Gemfile
|
||||||
5
Gemfile
Normal file
5
Gemfile
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
source 'http://rubygems.org'
|
||||||
|
gem 'rake'
|
||||||
|
gem 'os'
|
||||||
|
gem 'albacore'
|
||||||
|
gem 'nokogiri'
|
||||||
54
Rakefile
Normal file
54
Rakefile
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
require 'bundler/setup'
|
||||||
|
require 'rake/clean'
|
||||||
|
require 'albacore'
|
||||||
|
require 'open-uri'
|
||||||
|
require 'fileutils'
|
||||||
|
require 'os'
|
||||||
|
require 'nokogiri'
|
||||||
|
import 'assets/tools.rake'
|
||||||
|
|
||||||
|
|
||||||
|
PACKAGES = File.expand_path("packages")
|
||||||
|
TOOLS = File.expand_path("tools")
|
||||||
|
NUGET = File.expand_path("#{TOOLS}/nuget")
|
||||||
|
Configuration = ENV['CONFIGURATION'] || 'Release'
|
||||||
|
|
||||||
|
desc 'retrieve dependencies'
|
||||||
|
task :retrieve => ['tools:nuget_fetch']
|
||||||
|
|
||||||
|
desc 'build the project'
|
||||||
|
task :build => [:compile]
|
||||||
|
|
||||||
|
desc 'Run the tests'
|
||||||
|
task :test => [:nunit]
|
||||||
|
|
||||||
|
desc 'Retrieve, Build, Test'
|
||||||
|
task :preflight => [:retrieve, :build, :test]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
build :compile => ['tools:nuget_fetch'] do |b|
|
||||||
|
b.prop 'Configuration', Configuration
|
||||||
|
b.sln = 'Untappd.Net.sln'
|
||||||
|
end
|
||||||
|
|
||||||
|
task :tp do
|
||||||
|
puts NUNIT
|
||||||
|
end
|
||||||
|
|
||||||
|
test_runner :nunit do |tests|
|
||||||
|
tests.files = FileList["src/**/*UnitTests/bin/#{Configuration}/*UnitTests.dll"] # dll files with test
|
||||||
|
tests.exe = "packages/NUnit.Runners.2.6.4/tools/nunit-console.exe" # executable to run tests with
|
||||||
|
end
|
||||||
|
|
||||||
|
# task :tests => :'tests:unit'
|
||||||
|
|
||||||
|
#task :ensure_nuget_key do
|
||||||
|
# raise 'missing env NUGET_KEY value' unless ENV['NUGET_KEY']
|
||||||
|
#end
|
||||||
|
|
||||||
|
#Albacore::Tasks::Release.new :release,
|
||||||
|
# pkg_dir: 'build/pkg',
|
||||||
|
# depend_on: [:create_nugets, :ensure_nuget_key],
|
||||||
|
# nuget_exe: 'packages/NuGet.CommandLine/tools/NuGet.exe',
|
||||||
|
# api_key: ENV['NUGET_KEY']
|
||||||
12
assets/puppet/init.pp
Normal file
12
assets/puppet/init.pp
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
include apt
|
||||||
|
class mono {
|
||||||
|
package { "mono-devel" :
|
||||||
|
ensure => "installed"
|
||||||
|
}
|
||||||
|
package { "mono-gmcs" :
|
||||||
|
ensure => "installed"
|
||||||
|
}
|
||||||
|
package { "mono-vbnc" :
|
||||||
|
ensure => "installed"
|
||||||
|
}
|
||||||
|
}
|
||||||
3
assets/puppet/site.pp
Normal file
3
assets/puppet/site.pp
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
import 'init.pp'
|
||||||
|
|
||||||
|
include mono
|
||||||
37
assets/tools.rake
Normal file
37
assets/tools.rake
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
namespace :tools do
|
||||||
|
|
||||||
|
# If we don't have a copy of nuget, download it
|
||||||
|
task :nuget_bootstrap do
|
||||||
|
puts 'Ensuring NuGet exists in tools/NuGet'
|
||||||
|
|
||||||
|
if !FileTest.exist?("#{NUGET}/nuget.exe")
|
||||||
|
puts 'Downloading nuget from nuget.org'
|
||||||
|
|
||||||
|
FileUtils.mkdir_p("#{NUGET}")
|
||||||
|
File.open("#{NUGET}/nuget.exe", "wb") do |file|
|
||||||
|
file.write open('http://nuget.org/nuget.exe').read
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Fetch nuget dependencies for all packages
|
||||||
|
task :nuget_fetch => :nuget_bootstrap do
|
||||||
|
|
||||||
|
# If we aren't running under windows, assume we're using mono
|
||||||
|
CMD_PREFIX = ""
|
||||||
|
if !OS.windows?
|
||||||
|
CMD_PREFIX = "mono"
|
||||||
|
begin
|
||||||
|
sh "mozroots --import --sync" #attempt to sync ssl things...
|
||||||
|
rescue
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Make sure we get solution-level deps
|
||||||
|
sh "#{CMD_PREFIX} #{NUGET}/nuget.exe i .nuget/packages.config -o packages"
|
||||||
|
|
||||||
|
FileList["**/packages.config"].each { |filepath|
|
||||||
|
sh "#{CMD_PREFIX} #{NUGET}/nuget.exe i #{filepath} -o packages"
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using Untappd.Net.Exception;
|
using Untappd.Net.Exception;
|
||||||
|
|
||||||
namespace Untappd.Net.UnitTests.Exception
|
namespace Untappd.Net.UnitTests.Exception
|
||||||
{
|
{
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
@@ -24,5 +23,7 @@ namespace Untappd.Net.UnitTests.Exception
|
|||||||
{
|
{
|
||||||
throw new BaseUntappdException("messageHere", new System.Exception("innerException!"));
|
throw new BaseUntappdException("messageHere", new System.Exception("innerException!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace Untappd.Net.UnitTests.Request
|
|||||||
request.Setup(a => a.AddParameter(It.IsAny<string>(), It.IsAny<string>()));
|
request.Setup(a => a.AddParameter(It.IsAny<string>(), It.IsAny<string>()));
|
||||||
|
|
||||||
var response = new Mock<IRestResponse>();
|
var response = new Mock<IRestResponse>();
|
||||||
response.Setup(a => a.Content).Returns(File.ReadAllText("../../Responses/json/BeerInfo.json"));
|
response.Setup(a => a.Content).Returns(File.ReadAllText("../../Responses/Json/BeerInfo.json"));
|
||||||
client.Setup(a => a.Execute(It.IsAny<IRestRequest>())).Callback(() =>
|
client.Setup(a => a.Execute(It.IsAny<IRestRequest>())).Callback(() =>
|
||||||
{
|
{
|
||||||
}).Returns(response.Object);
|
}).Returns(response.Object);
|
||||||
|
|||||||
Reference in New Issue
Block a user