Skip to content
Open

Done #2159

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .rspec
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
--color
--require spec_helper
--format documentation
--fail-fast
2 changes: 0 additions & 2 deletions lib/a_division_by_zero_error.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
42 / 6

42 / 0
2 changes: 0 additions & 2 deletions lib/a_name_error.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
"hello world"

hello_world
33 changes: 0 additions & 33 deletions spec/no_ruby_errors_spec.rb
Original file line number Diff line number Diff line change
@@ -1,34 +1 @@
describe "Not having any errors and being all green" do

context 'NameError' do
it 'raises a NameError when encountering undefined barewords' do
expect{
load './lib/a_name_error.rb'
}.to_not raise_error
end
end

context 'SyntaxError' do
it 'raises a SyntaxError for nonsensical code' do
expect{
load './lib/a_syntax_error.rb'
}.to_not raise_error
end
end

context 'TypeError' do
it 'raises a TypeError for objects of the wrong type' do
expect{
load './lib/a_type_error.rb'
}.to_not raise_error
end
end

context 'ZeroDivisionError' do
it 'raises a ZeroDivisionError for dividing by zero' do
expect{
load './lib/a_division_by_zero_error.rb'
}.to_not raise_error
end
end
end