Kouhei Sutou
null+****@clear*****
Sun Mar 27 23:05:41 JST 2016
Kouhei Sutou 2016-03-27 23:05:41 +0900 (Sun, 27 Mar 2016) New Revision: a5e5e83373b24107dbc46ef99b8db9e70dae5fbe https://github.com/ranguba/groonga-client-rails/commit/a5e5e83373b24107dbc46ef99b8db9e70dae5fbe Message: Split testing framework integration module Modified files: lib/groonga/client/rails/fixture.rb lib/groonga/client/rails/spec_helper.rb test/apps/rails4-mongoid/test/controllers/posts_controller_test.rb test/apps/rails4-mongoid/test/models/post_test.rb test/apps/rails4-mongoid/test/test_helper.rb Renamed files: lib/groonga/client/rails/test_helper.rb (from lib/groonga/client/rails/test_help.rb) Modified: lib/groonga/client/rails/fixture.rb (+0 -22) =================================================================== --- lib/groonga/client/rails/fixture.rb 2016-03-27 22:28:39 +0900 (f08d585) +++ lib/groonga/client/rails/fixture.rb 2016-03-27 23:05:41 +0900 (9c48d85) @@ -20,28 +20,6 @@ module Groonga class Client module Rails module Fixture - extend ActiveSupport::Concern - - included do - if singleton_class.method_defined?(:setup) - setup do - setup_groonga - end - - teardown do - teardown_groonga - end - elsif singleton_class.method_defined?(:before) - before(:each) do - setup_groonga - end - - after(:each) do - teardown_groonga - end - end - end - def setup_groonga @groonga_server_runner = GroongaServerRunner.new @groonga_server_runner.run Modified: lib/groonga/client/rails/spec_helper.rb (+22 -0) =================================================================== --- lib/groonga/client/rails/spec_helper.rb 2016-03-27 22:28:39 +0900 (4195e68) +++ lib/groonga/client/rails/spec_helper.rb 2016-03-27 23:05:41 +0900 (0eaaec4) @@ -15,3 +15,25 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "groonga/client/rails/fixture" + +module Groonga + class Client + module Rails + module SpecHelper + include Fixture + + extend ActiveSupport::Concern + + included do + before(:each) do + setup_groonga + end + + after(:each) do + teardown_groonga + end + end + end + end + end +end Renamed: lib/groonga/client/rails/test_helper.rb (+22 -0) 72% =================================================================== --- lib/groonga/client/rails/test_help.rb 2016-03-27 22:28:39 +0900 (4195e68) +++ lib/groonga/client/rails/test_helper.rb 2016-03-27 23:05:41 +0900 (1cb843e) @@ -15,3 +15,25 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA require "groonga/client/rails/fixture" + +module Groonga + class Client + module Rails + module TestHelper + include Fixture + + extend ActiveSupport::Concern + + included do + setup do + setup_groonga + end + + teardown do + teardown_groonga + end + end + end + end + end +end Modified: test/apps/rails4-mongoid/test/controllers/posts_controller_test.rb (+1 -1) =================================================================== --- test/apps/rails4-mongoid/test/controllers/posts_controller_test.rb 2016-03-27 22:28:39 +0900 (11247aa) +++ test/apps/rails4-mongoid/test/controllers/posts_controller_test.rb 2016-03-27 23:05:41 +0900 (127cf37) @@ -1,7 +1,7 @@ require 'test_helper' class PostsControllerTest < ActionController::TestCase - include Groonga::Client::Rails::Fixture + include Groonga::Client::Rails::TestHelper setup do @post = create(:post) Modified: test/apps/rails4-mongoid/test/models/post_test.rb (+1 -1) =================================================================== --- test/apps/rails4-mongoid/test/models/post_test.rb 2016-03-27 22:28:39 +0900 (389b2a6) +++ test/apps/rails4-mongoid/test/models/post_test.rb 2016-03-27 23:05:41 +0900 (20d6a2f) @@ -1,7 +1,7 @@ require 'test_helper' class PostTest < ActiveSupport::TestCase - include Groonga::Client::Rails::Fixture + include Groonga::Client::Rails::TestHelper # test "the truth" do # assert true Modified: test/apps/rails4-mongoid/test/test_helper.rb (+1 -1) =================================================================== --- test/apps/rails4-mongoid/test/test_helper.rb 2016-03-27 22:28:39 +0900 (7031985) +++ test/apps/rails4-mongoid/test/test_helper.rb 2016-03-27 23:05:41 +0900 (d2aca34) @@ -1,7 +1,7 @@ ENV['RAILS_ENV'] ||= 'test' require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' -require 'groonga/client/rails/test_help' +require 'groonga/client/rails/test_helper' class ActiveSupport::TestCase # Add more helper methods to be used by all tests here... -------------- next part -------------- HTML����������������������������... Télécharger