Skip to content

Commit

Permalink
ジェネレータのロガー関係のテストが失敗するので修正
Browse files Browse the repository at this point in the history
テストのために毎回無駄なインスタンス化を行なっている
  • Loading branch information
koi-chan committed Jul 22, 2019
1 parent 34e8f29 commit a30d8c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/rgrb/generator_plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module GeneratorPlugin
def initialize
class_name_tree = self.class.name.split('::')
@plugin_name_underscore = class_name_tree[-2].underscore
@logger = Lumberjack::Logger.new($stdout, progname: self.class.to_s)
end

# RGRB のルートパスを設定する
Expand Down
6 changes: 3 additions & 3 deletions spec/rgrb/plugin/configurable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

require_relative '../../spec_helper'

require 'rgrb/plugin/configurable_generator'
require 'rgrb/generator_plugin'
require 'rgrb/plugin/configurable_adapter'

module RGRB
module Plugin
module TestPlugin
class Generator
include ConfigurableGenerator
include GeneratorPlugin

attr_reader :logger
attr_reader :name
Expand Down Expand Up @@ -40,7 +40,7 @@ def config
end
end

describe RGRB::Plugin::ConfigurableGenerator do
describe RGRB::GeneratorPlugin do
let(:generator) { RGRB::Plugin::TestPlugin::Generator.new }

describe '#root_path=' do
Expand Down

0 comments on commit a30d8c6

Please sign in to comment.