[Groonga-commit] ranguba/groonga-client-model at 5c53797 [master] Add test helper

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Dec 12 12:31:23 JST 2016


Kouhei Sutou	2016-12-12 12:31:23 +0900 (Mon, 12 Dec 2016)

  New Revision: 5c537973d1185456c5d48d4e10d8cf247b1bb605
  https://github.com/ranguba/groonga-client-model/commit/5c537973d1185456c5d48d4e10d8cf247b1bb605

  Message:
    Add test helper

  Copied files:
    lib/groonga_client_model/spec_helper.rb
      (from Gemfile)
    lib/groonga_client_model/test_helper.rb
      (from Gemfile)
  Modified files:
    .travis.yml
    Gemfile
    groonga-client-model.gemspec
    test/apps/rails5/Gemfile
    test/apps/rails5/Gemfile.lock
    test/apps/rails5/test/controllers/posts_controller_test.rb
    test/apps/rails5/test/test_helper.rb
    test/run-test.rb
    test/unit/test_load_value_generator.rb
    test/unit/test_record.rb

  Modified: .travis.yml (+1 -0)
===================================================================
--- .travis.yml    2016-12-09 18:46:44 +0900 (5c78afc)
+++ .travis.yml    2016-12-12 12:31:23 +0900 (725b9da)
@@ -9,6 +9,7 @@ before_install:
   - curl --silent --location https://github.com/groonga/groonga/raw/master/data/travis/setup.sh | sh
   - sudo apt-get -qq -y install groonga-bin groonga-httpd groonga-tokenizer-mecab
   - gem update bundler
+  - git clone --depth 1 https://github.com/ranguba/groonga-client.git ../groonga-client
 install:
   - bundle install --jobs=3 --retry=3
   - |

  Modified: Gemfile (+2 -0)
===================================================================
--- Gemfile    2016-12-09 18:46:44 +0900 (641196c)
+++ Gemfile    2016-12-12 12:31:23 +0900 (8ebd14e)
@@ -19,3 +19,5 @@
 source "https://rubygems.org/"
 
 gemspec
+
+gem "groonga-client", path: "../groonga-client"

  Modified: groonga-client-model.gemspec (+1 -1)
===================================================================
--- groonga-client-model.gemspec    2016-12-09 18:46:44 +0900 (952f6bf)
+++ groonga-client-model.gemspec    2016-12-12 12:31:23 +0900 (d777822)
@@ -43,7 +43,7 @@ Gem::Specification.new do |spec|
   spec.files += Dir.glob("doc/text/*")
   spec.test_files += Dir.glob("test/**/*")
 
-  spec.add_runtime_dependency("groonga-client", ">= 0.3.3")
+  spec.add_runtime_dependency("groonga-client", ">= 0.3.4")
   spec.add_runtime_dependency("groonga-command-parser")
   spec.add_runtime_dependency("activemodel")
 

  Copied: lib/groonga_client_model/spec_helper.rb (+10 -4) 80%
===================================================================
--- Gemfile    2016-12-09 18:46:44 +0900 (641196c)
+++ lib/groonga_client_model/spec_helper.rb    2016-12-12 12:31:23 +0900 (445636c)
@@ -1,5 +1,3 @@
-# -*- ruby -*-
-#
 # Copyright (C) 2016  Kouhei Sutou <kou �� clear-code.com>
 #
 # This library is free software; you can redistribute it and/or
@@ -16,6 +14,14 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
-source "https://rubygems.org/"
+require "groonga/client/spec-helper"
+
+module GroongaClientModel
+  module SpecHelper
+    extend ActiveSupport::Concern
 
-gemspec
+    included do
+      include Groonga::Client::SpecHelper
+    end
+  end
+end

  Copied: lib/groonga_client_model/test_helper.rb (+10 -4) 80%
===================================================================
--- Gemfile    2016-12-09 18:46:44 +0900 (641196c)
+++ lib/groonga_client_model/test_helper.rb    2016-12-12 12:31:23 +0900 (fb4b980)
@@ -1,5 +1,3 @@
-# -*- ruby -*-
-#
 # Copyright (C) 2016  Kouhei Sutou <kou �� clear-code.com>
 #
 # This library is free software; you can redistribute it and/or
@@ -16,6 +14,14 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
-source "https://rubygems.org/"
+require "groonga/client/test-helper"
+
+module GroongaClientModel
+  module TestHelper
+    extend ActiveSupport::Concern
 
-gemspec
+    included do
+      include Groonga::Client::TestHelper
+    end
+  end
+end

  Modified: test/apps/rails5/Gemfile (+1 -0)
===================================================================
--- test/apps/rails5/Gemfile    2016-12-09 18:46:44 +0900 (17b88bf)
+++ test/apps/rails5/Gemfile    2016-12-12 12:31:23 +0900 (df2f865)
@@ -47,3 +47,4 @@ end
 gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
 
 gem 'groonga-client-model', path: '../../../'
+gem 'groonga-client', path: '../../../../groonga-client'

  Modified: test/apps/rails5/Gemfile.lock (+12 -7)
===================================================================
--- test/apps/rails5/Gemfile.lock    2016-12-09 18:46:44 +0900 (9bd18a6)
+++ test/apps/rails5/Gemfile.lock    2016-12-12 12:31:23 +0900 (bc38bc3)
@@ -1,9 +1,17 @@
 PATH
+  remote: ../../../../groonga-client
+  specs:
+    groonga-client (0.3.4)
+      gqtp (>= 1.0.4)
+      groonga-command (>= 1.2.8)
+      hashie
+
+PATH
   remote: ../../../
   specs:
     groonga-client-model (0.9.0)
       activemodel
-      groonga-client (>= 0.3.2)
+      groonga-client (>= 0.3.4)
       groonga-command-parser
 
 GEM
@@ -66,16 +74,12 @@ GEM
       factory_girl (~> 4.5.0)
       railties (>= 3.0.0)
     ffi (1.9.14)
-    ffi-yajl (2.3.0)
+    ffi-yajl (2.2.3)
       libyajl2 (~> 1.2)
     globalid (0.3.7)
       activesupport (>= 4.1.0)
     gqtp (1.0.6)
-    groonga-client (0.3.2)
-      gqtp (>= 1.0.4)
-      groonga-command (>= 1.2.8)
-      hashie
-    groonga-command (1.2.9)
+    groonga-command (1.3.1)
       json
     groonga-command-parser (1.0.5)
       ffi
@@ -185,6 +189,7 @@ DEPENDENCIES
   byebug
   coffee-rails (~> 4.2)
   factory_girl_rails
+  groonga-client!
   groonga-client-model!
   jbuilder (~> 2.5)
   jquery-rails

  Modified: test/apps/rails5/test/controllers/posts_controller_test.rb (+2 -0)
===================================================================
--- test/apps/rails5/test/controllers/posts_controller_test.rb    2016-12-09 18:46:44 +0900 (b45c481)
+++ test/apps/rails5/test/controllers/posts_controller_test.rb    2016-12-12 12:31:23 +0900 (dc8397e)
@@ -1,6 +1,8 @@
 require 'test_helper'
 
 class PostsControllerTest < ActionDispatch::IntegrationTest
+  include GroongaClientModel::TestHelper
+
   setup do
     @post = create(:post)
   end

  Modified: test/apps/rails5/test/test_helper.rb (+1 -0)
===================================================================
--- test/apps/rails5/test/test_helper.rb    2016-12-09 18:46:44 +0900 (2d79611)
+++ test/apps/rails5/test/test_helper.rb    2016-12-12 12:31:23 +0900 (66f92f8)
@@ -1,6 +1,7 @@
 ENV['RAILS_ENV'] ||= 'test'
 require File.expand_path('../../config/environment', __FILE__)
 require 'rails/test_help'
+require 'groonga_client_model/test_helper'
 
 class ActiveSupport::TestCase
   # Add more helper methods to be used by all tests here...

  Modified: test/run-test.rb (+3 -1)
===================================================================
--- test/run-test.rb    2016-12-09 18:46:44 +0900 (c2e96a8)
+++ test/run-test.rb    2016-12-12 12:31:23 +0900 (1d4965a)
@@ -34,8 +34,10 @@ Dir.glob("#{__dir__}/apps/*") do |test_application|
     RbConfig.ruby,
     "bin/rails",
     "test",
-    "TESTOPTS=#{ARGV.join(' ')}",
   ]
+  unless ARGV.empty?
+    command_line << "TESTOPTS=#{ARGV.join(' ')}"
+  end
   options = {
     :chdir => test_application,
   }

  Modified: test/unit/test_load_value_generator.rb (+4 -2)
===================================================================
--- test/unit/test_load_value_generator.rb    2016-12-09 18:46:44 +0900 (b406803)
+++ test/unit/test_load_value_generator.rb    2016-12-12 12:31:23 +0900 (3026e2b)
@@ -18,7 +18,8 @@ class TestLoadValueGenerator < Test::Unit::TestCase
   class Memo < GroongaClientModel::Record
     class << self
       def columns
-        GroongaClientModel::Schema::Columns.new("tag" => {},
+        GroongaClientModel::Schema::Columns.new(nil,
+                                                "tag" => {},
                                                 "tags" => {},
                                                 "created_at" => {})
       end
@@ -28,7 +29,8 @@ class TestLoadValueGenerator < Test::Unit::TestCase
   class Tag < GroongaClientModel::Record
     class << self
       def columns
-        GroongaClientModel::Schema::Columns.new("_key" => {})
+        GroongaClientModel::Schema::Columns.new(nil,
+                                                "_key" => {})
       end
     end
   end

  Modified: test/unit/test_record.rb (+2 -2)
===================================================================
--- test/unit/test_record.rb    2016-12-09 18:46:44 +0900 (3828f65)
+++ test/unit/test_record.rb    2016-12-12 12:31:23 +0900 (18fff3c)
@@ -19,7 +19,7 @@ class TestRecord < Test::Unit::TestCase
     class EmptyModel < GroongaClientModel::Record
       class << self
         def columns
-          GroongaClientModel::Schema::Columns.new("_id" => {})
+          GroongaClientModel::Schema::Columns.new(nil, "_id" => {})
         end
       end
     end
@@ -35,7 +35,7 @@ class TestRecord < Test::Unit::TestCase
     class Memo < GroongaClientModel::Record
       class << self
         def columns
-          GroongaClientModel::Schema::Columns.new("_id" => {})
+          GroongaClientModel::Schema::Columns.new(nil, "_id" => {})
         end
       end
     end
-------------- next part --------------
HTML����������������������������...
다운로드 



More information about the Groonga-commit mailing list
Back to archive index