From 422a2923e3a4767e313726056aa7de60218510a2 Mon Sep 17 00:00:00 2001 From: orga Date: Tue, 27 Sep 2016 18:34:54 +0800 Subject: [PATCH] add travis config --- .travis.yml | 11 +++++++++++ Gemfile | 4 ++++ Gemfile.lock | 10 ++++++++++ test/fixtures/goods.yml | 6 ++++-- test/models/good_test.rb | 7 ++++--- test/test_helper.rb | 3 +++ 6 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..f9799fd --- /dev/null +++ b/.travis.yml @@ -0,0 +1,11 @@ +language: ruby +sudo: false +cache: bundler +bundler_args: --retry=3 --jobs=3 +before_script: + - bin/setup + - bin/rake db:test:prepare +rvm: + - 2.3.1 +matrix: + fast_finish: true diff --git a/Gemfile b/Gemfile index 9e3c64a..946dad5 100644 --- a/Gemfile +++ b/Gemfile @@ -65,3 +65,7 @@ gem 'graphiql-rails' # Handle CORS gem 'rack-cors', require: 'rack/cors' + +group :test do + gem 'codeclimate-test-reporter', require: false +end diff --git a/Gemfile.lock b/Gemfile.lock index 451614b..d0823b4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -42,6 +42,8 @@ GEM ast (2.3.0) builder (3.2.2) byebug (9.0.5) + codeclimate-test-reporter (0.6.0) + simplecov (>= 0.7.1, < 1.0.0) coffee-rails (4.2.1) coffee-script (>= 2.2.0) railties (>= 4.0.0, < 5.2.x) @@ -51,6 +53,7 @@ GEM coffee-script-source (1.10.0) concurrent-ruby (1.0.2) debug_inspector (0.0.2) + docile (1.1.5) erubis (2.7.0) execjs (2.7.0) ffi (1.9.14) @@ -67,6 +70,7 @@ GEM rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) + json (2.0.2) listen (3.0.8) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) @@ -137,6 +141,11 @@ GEM sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) + simplecov (0.12.0) + docile (~> 1.1.0) + json (>= 1.8, < 3) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.0) spring (1.7.2) spring-watcher-listen (2.0.0) listen (>= 2.7, < 4.0) @@ -174,6 +183,7 @@ PLATFORMS DEPENDENCIES byebug + codeclimate-test-reporter coffee-rails (~> 4.2) graphiql-rails graphql diff --git a/test/fixtures/goods.yml b/test/fixtures/goods.yml index 80aed36..f8ded0b 100644 --- a/test/fixtures/goods.yml +++ b/test/fixtures/goods.yml @@ -4,8 +4,10 @@ # model remove the '{}' from the fixture names and add the columns immediately # below each fixture, per the syntax in the comments below # -one: {} -# column: value +plane: + title: plane + description: WTF expensive + bidding_time: <%= 2.days.ago %> # two: {} # column: value diff --git a/test/models/good_test.rb b/test/models/good_test.rb index d5b5b7d..6bd1940 100644 --- a/test/models/good_test.rb +++ b/test/models/good_test.rb @@ -1,7 +1,8 @@ require 'test_helper' class GoodTest < ActiveSupport::TestCase - # test "the truth" do - # assert true - # end + test 'title' do + plane = goods(:plane) + assert plane.title == 'plane' + end end diff --git a/test/test_helper.rb b/test/test_helper.rb index 92e39b2..504cc8a 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,6 +1,9 @@ ENV['RAILS_ENV'] ||= 'test' require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' +require 'codeclimate-test-reporter' + +CodeClimate::TestReporter.start class ActiveSupport::TestCase # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.