From df9c6c694adb579654f081efc15e87515c3df8e3 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli Date: Sun, 18 Sep 2016 12:45:16 -0400 Subject: [PATCH] restructure a bit --- lib/rails_module_unification.rb | 12 +- lib/rails_module_unification/railtie.rb | 2 +- spec/support/rails_app/Gemfile | 1 + .../channels/application_cable/channel.rb | 0 .../channels/application_cable/connection.rb | 0 .../data/models/application_record.rb | 0 .../app/{mu => }/data/models/author.rb | 0 .../app/{mu => }/data/models/post.rb | 0 .../app/{mu => }/jobs/application_job.rb | 0 .../{mu => }/mailers/application_mailer.rb | 0 .../resources/api/authors/controller.rb | 0 .../resources/api/authors/serializer.rb | 0 .../{mu => }/resources/api/base_controller.rb | 0 .../resources/api/posts/post_serializer.rb | 0 .../resources/api/posts/posts_controller.rb | 0 .../resources/application_controller.rb | 0 .../{mu => }/resources/comments/controller.rb | 0 .../{mu => }/resources/comments/serializer.rb | 0 spec/support/rails_app/config/application.rb | 1 - spec/support/rails_app/config/environment.rb | 2 - .../initializers/rails_module_unification.rb | 3 + spec/support/rails_app/log/development.log | 110 ++++++++++++++++++ spec/unit/active_support_extensions_spec.rb | 16 +++ 23 files changed, 142 insertions(+), 5 deletions(-) rename spec/support/rails_app/app/{mu => }/channels/application_cable/channel.rb (100%) rename spec/support/rails_app/app/{mu => }/channels/application_cable/connection.rb (100%) rename spec/support/rails_app/app/{mu => }/data/models/application_record.rb (100%) rename spec/support/rails_app/app/{mu => }/data/models/author.rb (100%) rename spec/support/rails_app/app/{mu => }/data/models/post.rb (100%) rename spec/support/rails_app/app/{mu => }/jobs/application_job.rb (100%) rename spec/support/rails_app/app/{mu => }/mailers/application_mailer.rb (100%) rename spec/support/rails_app/app/{mu => }/resources/api/authors/controller.rb (100%) rename spec/support/rails_app/app/{mu => }/resources/api/authors/serializer.rb (100%) rename spec/support/rails_app/app/{mu => }/resources/api/base_controller.rb (100%) rename spec/support/rails_app/app/{mu => }/resources/api/posts/post_serializer.rb (100%) rename spec/support/rails_app/app/{mu => }/resources/api/posts/posts_controller.rb (100%) rename spec/support/rails_app/app/{mu => }/resources/application_controller.rb (100%) rename spec/support/rails_app/app/{mu => }/resources/comments/controller.rb (100%) rename spec/support/rails_app/app/{mu => }/resources/comments/serializer.rb (100%) create mode 100644 spec/support/rails_app/config/initializers/rails_module_unification.rb create mode 100644 spec/unit/active_support_extensions_spec.rb diff --git a/lib/rails_module_unification.rb b/lib/rails_module_unification.rb index 70507a4..d354f24 100644 --- a/lib/rails_module_unification.rb +++ b/lib/rails_module_unification.rb @@ -6,6 +6,16 @@ module RailsModuleUnification extend ActiveSupport::Autoload + module_function + + def directory=(dir) + @directory = dir + end + + def directory + @directory || '' + end + require 'rails_module_unification/railtie' - ActiveSupport::Dependencies.extend ActiveSupportExtensions + ActiveSupport::Dependencies.extend RailsModuleUnification::ActiveSupportExtensions end diff --git a/lib/rails_module_unification/railtie.rb b/lib/rails_module_unification/railtie.rb index 51dc53c..b436145 100644 --- a/lib/rails_module_unification/railtie.rb +++ b/lib/rails_module_unification/railtie.rb @@ -5,7 +5,7 @@ module RailsModuleUnification class Railtie < Rails::Railtie initializer 'activeservice.autoload', before: :set_autoload_paths do |app| # TODO: make the module unification root directory configurable - mu_dir = "#{Rails.root}/app/mu" + mu_dir = "#{Rails.root}/app/#{RailsModuleUnification.directory}" # Data data_paths = Dir["#{mu_dir}/data/**/"] diff --git a/spec/support/rails_app/Gemfile b/spec/support/rails_app/Gemfile index ca79b14..3aea064 100644 --- a/spec/support/rails_app/Gemfile +++ b/spec/support/rails_app/Gemfile @@ -7,6 +7,7 @@ gem 'rails', '~> 5.0.0' gem 'sqlite3' gem 'active_model_serializers' +gem 'rails_module_unification', path: '../rails_module_unification' # Use Puma as the app server gem 'puma', '~> 3.0' diff --git a/spec/support/rails_app/app/mu/channels/application_cable/channel.rb b/spec/support/rails_app/app/channels/application_cable/channel.rb similarity index 100% rename from spec/support/rails_app/app/mu/channels/application_cable/channel.rb rename to spec/support/rails_app/app/channels/application_cable/channel.rb diff --git a/spec/support/rails_app/app/mu/channels/application_cable/connection.rb b/spec/support/rails_app/app/channels/application_cable/connection.rb similarity index 100% rename from spec/support/rails_app/app/mu/channels/application_cable/connection.rb rename to spec/support/rails_app/app/channels/application_cable/connection.rb diff --git a/spec/support/rails_app/app/mu/data/models/application_record.rb b/spec/support/rails_app/app/data/models/application_record.rb similarity index 100% rename from spec/support/rails_app/app/mu/data/models/application_record.rb rename to spec/support/rails_app/app/data/models/application_record.rb diff --git a/spec/support/rails_app/app/mu/data/models/author.rb b/spec/support/rails_app/app/data/models/author.rb similarity index 100% rename from spec/support/rails_app/app/mu/data/models/author.rb rename to spec/support/rails_app/app/data/models/author.rb diff --git a/spec/support/rails_app/app/mu/data/models/post.rb b/spec/support/rails_app/app/data/models/post.rb similarity index 100% rename from spec/support/rails_app/app/mu/data/models/post.rb rename to spec/support/rails_app/app/data/models/post.rb diff --git a/spec/support/rails_app/app/mu/jobs/application_job.rb b/spec/support/rails_app/app/jobs/application_job.rb similarity index 100% rename from spec/support/rails_app/app/mu/jobs/application_job.rb rename to spec/support/rails_app/app/jobs/application_job.rb diff --git a/spec/support/rails_app/app/mu/mailers/application_mailer.rb b/spec/support/rails_app/app/mailers/application_mailer.rb similarity index 100% rename from spec/support/rails_app/app/mu/mailers/application_mailer.rb rename to spec/support/rails_app/app/mailers/application_mailer.rb diff --git a/spec/support/rails_app/app/mu/resources/api/authors/controller.rb b/spec/support/rails_app/app/resources/api/authors/controller.rb similarity index 100% rename from spec/support/rails_app/app/mu/resources/api/authors/controller.rb rename to spec/support/rails_app/app/resources/api/authors/controller.rb diff --git a/spec/support/rails_app/app/mu/resources/api/authors/serializer.rb b/spec/support/rails_app/app/resources/api/authors/serializer.rb similarity index 100% rename from spec/support/rails_app/app/mu/resources/api/authors/serializer.rb rename to spec/support/rails_app/app/resources/api/authors/serializer.rb diff --git a/spec/support/rails_app/app/mu/resources/api/base_controller.rb b/spec/support/rails_app/app/resources/api/base_controller.rb similarity index 100% rename from spec/support/rails_app/app/mu/resources/api/base_controller.rb rename to spec/support/rails_app/app/resources/api/base_controller.rb diff --git a/spec/support/rails_app/app/mu/resources/api/posts/post_serializer.rb b/spec/support/rails_app/app/resources/api/posts/post_serializer.rb similarity index 100% rename from spec/support/rails_app/app/mu/resources/api/posts/post_serializer.rb rename to spec/support/rails_app/app/resources/api/posts/post_serializer.rb diff --git a/spec/support/rails_app/app/mu/resources/api/posts/posts_controller.rb b/spec/support/rails_app/app/resources/api/posts/posts_controller.rb similarity index 100% rename from spec/support/rails_app/app/mu/resources/api/posts/posts_controller.rb rename to spec/support/rails_app/app/resources/api/posts/posts_controller.rb diff --git a/spec/support/rails_app/app/mu/resources/application_controller.rb b/spec/support/rails_app/app/resources/application_controller.rb similarity index 100% rename from spec/support/rails_app/app/mu/resources/application_controller.rb rename to spec/support/rails_app/app/resources/application_controller.rb diff --git a/spec/support/rails_app/app/mu/resources/comments/controller.rb b/spec/support/rails_app/app/resources/comments/controller.rb similarity index 100% rename from spec/support/rails_app/app/mu/resources/comments/controller.rb rename to spec/support/rails_app/app/resources/comments/controller.rb diff --git a/spec/support/rails_app/app/mu/resources/comments/serializer.rb b/spec/support/rails_app/app/resources/comments/serializer.rb similarity index 100% rename from spec/support/rails_app/app/mu/resources/comments/serializer.rb rename to spec/support/rails_app/app/resources/comments/serializer.rb diff --git a/spec/support/rails_app/config/application.rb b/spec/support/rails_app/config/application.rb index 58fbf82..f28ee59 100644 --- a/spec/support/rails_app/config/application.rb +++ b/spec/support/rails_app/config/application.rb @@ -1,5 +1,4 @@ require_relative 'boot' - require 'rails/all' # Require the gems listed in Gemfile, including any gems diff --git a/spec/support/rails_app/config/environment.rb b/spec/support/rails_app/config/environment.rb index d2be802..426333b 100644 --- a/spec/support/rails_app/config/environment.rb +++ b/spec/support/rails_app/config/environment.rb @@ -1,7 +1,5 @@ # Load the Rails application. require_relative 'application' -require 'rails_module_unification' - # Initialize the Rails application. Rails.application.initialize! diff --git a/spec/support/rails_app/config/initializers/rails_module_unification.rb b/spec/support/rails_app/config/initializers/rails_module_unification.rb new file mode 100644 index 0000000..801a433 --- /dev/null +++ b/spec/support/rails_app/config/initializers/rails_module_unification.rb @@ -0,0 +1,3 @@ +# TODO: this currently doesn't work, because the railtie +# adds to the autoload paths before this file is required +# RailsModuleUnification.directory = 'mu' diff --git a/spec/support/rails_app/log/development.log b/spec/support/rails_app/log/development.log index 22eceab..8fb9522 100644 --- a/spec/support/rails_app/log/development.log +++ b/spec/support/rails_app/log/development.log @@ -824,3 +824,113 @@ DEPRECATION WARNING: Passing #original_exception is deprecated and has no effect  (0.0ms) begin transaction SQL (0.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "environment"], ["value", "development"], ["created_at", 2016-09-18 02:06:06 UTC], ["updated_at", 2016-09-18 02:06:06 UTC]]  (0.0ms) commit transaction +  (0.2ms) CREATE TABLE "authors" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) +  (0.1ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "body" text, "title" varchar, "author_id" integer) +  (0.0ms) select sqlite_version(*) +  (0.1ms) CREATE INDEX "index_posts_on_author_id" ON "posts" ("author_id") +  (0.1ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "project_url" text, "bio" text, "birthday" date, "author_id" integer) +  (0.1ms) CREATE INDEX "index_profiles_on_author_id" ON "profiles" ("author_id") +  (0.1ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) + ActiveRecord::InternalMetadata Load (0.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", :environment], ["LIMIT", 1]] +  (0.1ms) begin transaction + SQL (0.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "environment"], ["value", "development"], ["created_at", 2016-09-18 15:26:04 UTC], ["updated_at", 2016-09-18 15:26:04 UTC]] +  (0.0ms) commit transaction +  (0.2ms) CREATE TABLE "authors" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) +  (0.1ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "body" text, "title" varchar, "author_id" integer) +  (0.1ms) select sqlite_version(*) +  (0.1ms) CREATE INDEX "index_posts_on_author_id" ON "posts" ("author_id") +  (0.1ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "project_url" text, "bio" text, "birthday" date, "author_id" integer) +  (0.1ms) CREATE INDEX "index_profiles_on_author_id" ON "profiles" ("author_id") +  (0.1ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) + ActiveRecord::InternalMetadata Load (0.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", :environment], ["LIMIT", 1]] +  (0.0ms) begin transaction + SQL (0.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "environment"], ["value", "development"], ["created_at", 2016-09-18 15:26:16 UTC], ["updated_at", 2016-09-18 15:26:16 UTC]] +  (0.0ms) commit transaction +  (0.4ms) CREATE TABLE "authors" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) +  (0.1ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "body" text, "title" varchar, "author_id" integer) +  (0.1ms) select sqlite_version(*) +  (0.1ms) CREATE INDEX "index_posts_on_author_id" ON "posts" ("author_id") +  (0.1ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "project_url" text, "bio" text, "birthday" date, "author_id" integer) +  (0.1ms) CREATE INDEX "index_profiles_on_author_id" ON "profiles" ("author_id") +  (0.1ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) + ActiveRecord::InternalMetadata Load (0.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", :environment], ["LIMIT", 1]] +  (0.0ms) begin transaction + SQL (0.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "environment"], ["value", "development"], ["created_at", 2016-09-18 15:55:43 UTC], ["updated_at", 2016-09-18 15:55:43 UTC]] +  (0.0ms) commit transaction +  (0.2ms) CREATE TABLE "authors" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) +  (0.1ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "body" text, "title" varchar, "author_id" integer) +  (0.1ms) select sqlite_version(*) +  (0.1ms) CREATE INDEX "index_posts_on_author_id" ON "posts" ("author_id") +  (0.1ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "project_url" text, "bio" text, "birthday" date, "author_id" integer) +  (0.1ms) CREATE INDEX "index_profiles_on_author_id" ON "profiles" ("author_id") +  (0.1ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) + ActiveRecord::InternalMetadata Load (0.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", :environment], ["LIMIT", 1]] +  (0.0ms) begin transaction + SQL (0.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "environment"], ["value", "development"], ["created_at", 2016-09-18 16:04:47 UTC], ["updated_at", 2016-09-18 16:04:47 UTC]] +  (0.0ms) commit transaction +  (0.2ms) CREATE TABLE "authors" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) +  (0.1ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "body" text, "title" varchar, "author_id" integer) +  (0.0ms) select sqlite_version(*) +  (0.1ms) CREATE INDEX "index_posts_on_author_id" ON "posts" ("author_id") +  (0.1ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "project_url" text, "bio" text, "birthday" date, "author_id" integer) +  (0.1ms) CREATE INDEX "index_profiles_on_author_id" ON "profiles" ("author_id") +  (0.1ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) + ActiveRecord::InternalMetadata Load (0.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", :environment], ["LIMIT", 1]] +  (0.0ms) begin transaction + SQL (0.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "environment"], ["value", "development"], ["created_at", 2016-09-18 16:05:24 UTC], ["updated_at", 2016-09-18 16:05:24 UTC]] +  (0.0ms) commit transaction +  (0.2ms) CREATE TABLE "authors" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) +  (0.1ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "body" text, "title" varchar, "author_id" integer) +  (0.1ms) select sqlite_version(*) +  (0.1ms) CREATE INDEX "index_posts_on_author_id" ON "posts" ("author_id") +  (0.1ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "project_url" text, "bio" text, "birthday" date, "author_id" integer) +  (0.1ms) CREATE INDEX "index_profiles_on_author_id" ON "profiles" ("author_id") +  (0.1ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) + ActiveRecord::InternalMetadata Load (0.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", :environment], ["LIMIT", 1]] +  (0.1ms) begin transaction + SQL (0.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "environment"], ["value", "development"], ["created_at", 2016-09-18 16:06:34 UTC], ["updated_at", 2016-09-18 16:06:34 UTC]] +  (0.0ms) commit transaction +  (0.2ms) CREATE TABLE "authors" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) +  (0.1ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "body" text, "title" varchar, "author_id" integer) +  (0.1ms) select sqlite_version(*) +  (0.1ms) CREATE INDEX "index_posts_on_author_id" ON "posts" ("author_id") +  (0.1ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "project_url" text, "bio" text, "birthday" date, "author_id" integer) +  (0.1ms) CREATE INDEX "index_profiles_on_author_id" ON "profiles" ("author_id") +  (0.1ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) + ActiveRecord::InternalMetadata Load (0.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", :environment], ["LIMIT", 1]] +  (0.0ms) begin transaction + SQL (0.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "environment"], ["value", "development"], ["created_at", 2016-09-18 16:06:56 UTC], ["updated_at", 2016-09-18 16:06:56 UTC]] +  (0.0ms) commit transaction +  (0.2ms) CREATE TABLE "authors" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) +  (0.1ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "body" text, "title" varchar, "author_id" integer) +  (0.0ms) select sqlite_version(*) +  (0.1ms) CREATE INDEX "index_posts_on_author_id" ON "posts" ("author_id") +  (0.1ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "project_url" text, "bio" text, "birthday" date, "author_id" integer) +  (0.1ms) CREATE INDEX "index_profiles_on_author_id" ON "profiles" ("author_id") +  (0.1ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) + ActiveRecord::InternalMetadata Load (0.3ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", :environment], ["LIMIT", 1]] +  (0.0ms) begin transaction + SQL (0.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "environment"], ["value", "development"], ["created_at", 2016-09-18 16:37:51 UTC], ["updated_at", 2016-09-18 16:37:51 UTC]] +  (0.0ms) commit transaction +  (0.2ms) CREATE TABLE "authors" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) +  (0.1ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "body" text, "title" varchar, "author_id" integer) +  (0.1ms) select sqlite_version(*) +  (0.1ms) CREATE INDEX "index_posts_on_author_id" ON "posts" ("author_id") +  (0.1ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "project_url" text, "bio" text, "birthday" date, "author_id" integer) +  (0.1ms) CREATE INDEX "index_profiles_on_author_id" ON "profiles" ("author_id") +  (0.1ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) + ActiveRecord::InternalMetadata Load (0.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", :environment], ["LIMIT", 1]] +  (0.0ms) begin transaction + SQL (0.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "environment"], ["value", "development"], ["created_at", 2016-09-18 16:40:53 UTC], ["updated_at", 2016-09-18 16:40:53 UTC]] +  (0.0ms) commit transaction +  (0.2ms) CREATE TABLE "authors" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar) +  (0.1ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "body" text, "title" varchar, "author_id" integer) +  (0.1ms) select sqlite_version(*) +  (0.1ms) CREATE INDEX "index_posts_on_author_id" ON "posts" ("author_id") +  (0.1ms) CREATE TABLE "profiles" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "project_url" text, "bio" text, "birthday" date, "author_id" integer) +  (0.1ms) CREATE INDEX "index_profiles_on_author_id" ON "profiles" ("author_id") +  (0.1ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) + ActiveRecord::InternalMetadata Load (0.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", :environment], ["LIMIT", 1]] +  (0.0ms) begin transaction + SQL (0.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "environment"], ["value", "development"], ["created_at", 2016-09-18 16:44:55 UTC], ["updated_at", 2016-09-18 16:44:55 UTC]] +  (0.0ms) commit transaction diff --git a/spec/unit/active_support_extensions_spec.rb b/spec/unit/active_support_extensions_spec.rb new file mode 100644 index 0000000..7d28bf6 --- /dev/null +++ b/spec/unit/active_support_extensions_spec.rb @@ -0,0 +1,16 @@ +require 'spec_helper' + +describe RailsModuleUnification::ActiveSupportExtensions do + describe 'load_from_parent' do + + end + + describe 'load_from_path' do + + end + + describe 'load_missing_constant' do + + + end +end