Skip to content

Commit 2c01787

Browse files
Reset options before running each spec
1 parent 7d535d4 commit 2c01787

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

lib/annotate.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ def self.setup_options(options = {})
7878
return options
7979
end
8080

81+
def self.reset_options
82+
[POSITION_OPTIONS, FLAG_OPTIONS, PATH_OPTIONS, OTHER_OPTIONS].flatten.each do |key|
83+
ENV[key.to_s] = nil
84+
end
85+
end
86+
8187
def self.skip_on_migration?
8288
ENV['skip_on_db_migrate'] =~ TRUE_RE
8389
end

spec/annotate/annotate_models_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ class User < ActiveRecord::Base
479479
mock_column(:name, :string, :limit => 50)
480480
])
481481
@schema_info = AnnotateModels.get_schema_info(@klass, "== Schema Info")
482+
Annotate.reset_options
482483
end
483484

484485
def write_model file_name, file_content

0 commit comments

Comments
 (0)