Skip to content

Commit

Permalink
Reset options before running each spec
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilbielawski committed Oct 26, 2015
1 parent 7d535d4 commit 2c01787
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/annotate.rb
Expand Up @@ -78,6 +78,12 @@ def self.setup_options(options = {})
return options
end

def self.reset_options
[POSITION_OPTIONS, FLAG_OPTIONS, PATH_OPTIONS, OTHER_OPTIONS].flatten.each do |key|
ENV[key.to_s] = nil
end
end

def self.skip_on_migration?
ENV['skip_on_db_migrate'] =~ TRUE_RE
end
Expand Down
1 change: 1 addition & 0 deletions spec/annotate/annotate_models_spec.rb
Expand Up @@ -479,6 +479,7 @@ class User < ActiveRecord::Base
mock_column(:name, :string, :limit => 50)
])
@schema_info = AnnotateModels.get_schema_info(@klass, "== Schema Info")
Annotate.reset_options
end

def write_model file_name, file_content
Expand Down

0 comments on commit 2c01787

Please sign in to comment.