Skip to content

Commit

Permalink
Remove SENSIBLE_STACK_TRACES feature
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdefreyne committed Jan 22, 2018
1 parent 6b5b66e commit fdb5aaa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 31 deletions.
1 change: 0 additions & 1 deletion nanoc/lib/nanoc/base/feature.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,3 @@ def self.all_outdated
end

Nanoc::Feature.define('live_cmd', version: '4.8')
Nanoc::Feature.define('sensible_stack_traces', version: '4.8')
5 changes: 1 addition & 4 deletions nanoc/lib/nanoc/cli/error_handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,7 @@ def write_verbose_error(error, stream)

# @api private
def forwards_stack_trace?
feature_enabled = Nanoc::Feature.enabled?(Nanoc::Feature::SENSIBLE_STACK_TRACES)
ruby_2_5_used = ruby_version.start_with?('2.5')

feature_enabled || ruby_2_5_used
ruby_version.start_with?('2.5')
end

# @api private
Expand Down
34 changes: 8 additions & 26 deletions nanoc/spec/nanoc/cli/error_handler_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,20 @@
describe '#forwards_stack_trace?' do
subject { error_handler.forwards_stack_trace? }

context 'feature enabled' do
around do |ex|
Nanoc::Feature.enable(Nanoc::Feature::SENSIBLE_STACK_TRACES) do
ex.run
end
end

context 'Ruby 2.4' do
it { is_expected.to be(true) }
context 'Ruby 2.4' do
before do
expect(error_handler).to receive(:ruby_version).and_return('2.4.2')
end

context 'Ruby 2.5' do
it { is_expected.to be(true) }
end
it { is_expected.to be(false) }
end

context 'feature not enabled' do
context 'Ruby 2.4' do
before do
expect(error_handler).to receive(:ruby_version).and_return('2.4.2')
end

it { is_expected.to be(false) }
context 'Ruby 2.5' do
before do
expect(error_handler).to receive(:ruby_version).and_return('2.5.0')
end

context 'Ruby 2.5' do
before do
expect(error_handler).to receive(:ruby_version).and_return('2.5.0')
end

it { is_expected.to be(true) }
end
it { is_expected.to be(true) }
end
end

Expand Down

0 comments on commit fdb5aaa

Please sign in to comment.