Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdefreyne committed Oct 22, 2016
1 parent fe3a0d2 commit df96165
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 58 deletions.
16 changes: 0 additions & 16 deletions lib/nanoc/base/feature.rb
Expand Up @@ -62,22 +62,6 @@ def self.enable(feature_name)
end
end

# @api private
def self.enable(feature_name)
raise ArgumentError, 'no block given' unless block_given?

if enabled?(feature_name)
yield
else
begin
enabled_features << feature_name
yield
ensure
enabled_features.delete(feature_name)
end
end
end

# @api private
def self.reset_caches
@enabled_features = nil
Expand Down
42 changes: 0 additions & 42 deletions spec/nanoc/base/feature_spec.rb
Expand Up @@ -71,48 +71,6 @@
end
end

describe '.enable' do
subject do
described_class.enable(feature_name) do
Nanoc::Feature.enabled?(feature_name)
end
end

let(:feature_name) { 'magic' }

before do
Nanoc::Feature.reset_caches
ENV['NANOC_FEATURES'] = ''
end

context 'not set' do
it { is_expected.to be }

it 'unsets afterwards' do
expect(Nanoc::Feature.enabled?(feature_name)).not_to be
end
end

context 'set to list not including feature' do
before { ENV['NANOC_FEATURES'] = 'foo,bar' }
it { is_expected.to be }

it 'unsets afterwards' do
expect(Nanoc::Feature.enabled?(feature_name)).not_to be
end
end

context 'set to all' do
before { ENV['NANOC_FEATURES'] = 'all' }
it { is_expected.to be }
end

context 'set to list including feature' do
before { ENV['NANOC_FEATURES'] = 'foo,magic,bar' }
it { is_expected.to be }
end
end

describe '.all_outdated' do
it 'refuses outdated features' do
# If this spec fails, there are features marked as experimental in the previous minor or major
Expand Down

0 comments on commit df96165

Please sign in to comment.