Skip to content

Commit

Permalink
Pass symbol as an argument to build instead of a block
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Nov 10, 2014
1 parent fd4b234 commit b75db89
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 15 deletions.
4 changes: 1 addition & 3 deletions spec/blackhole_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
describe 'black hole null object' do
subject(:null) { null_class.new }
let(:null_class) do
Naught.build do |b|
b.black_hole
end
Naught.build(&:black_hole)
end

it 'returns self from arbitray method calls' do
Expand Down
4 changes: 1 addition & 3 deletions spec/explicit_conversions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

describe 'explicitly convertable null object' do
let(:null_class) do
Naught.build do |b|
b.define_explicit_conversions
end
Naught.build(&:define_explicit_conversions)
end
subject(:null) { null_class.new }

Expand Down
4 changes: 1 addition & 3 deletions spec/implicit_conversions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
describe 'implicitly convertable null object' do
subject(:null) { null_class.new }
let(:null_class) do
Naught.build do |b|
b.define_implicit_conversions
end
Naught.build(&:define_implicit_conversions)
end
it 'implicitly splats the same way an empty array does' do
a, b = null
Expand Down
4 changes: 1 addition & 3 deletions spec/naught_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ def y
end
let(:instantiation_line) { null_object_and_line.last }
let(:trace_null_class) do
Naught.build do |b|
b.traceable
end
Naught.build(&:traceable)
end

it 'remembers the file it was instantiated from' do
Expand Down
4 changes: 1 addition & 3 deletions spec/singleton_null_object_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

describe 'singleton null object' do
subject(:null_class) do
Naught.build do |b|
b.singleton
end
Naught.build(&:singleton)
end

it 'does not respond to .new' do
Expand Down

0 comments on commit b75db89

Please sign in to comment.