For these tests, you should use regular brackets:
expect(Team.new("Random name")).to eq :name
When you use curly braces, you pass a block of code. For rspec3, this means that you will rely on the execution of this block and not on the result of the execution, for example,
expect { raise 'hello' }.to raise_error
EDIT:
Note that this test fails because Team.new returns an object, not a character. You can change your test to pass:
expect(Team.new("Random name")).to respond_to :name # or expect(Team.new("Random name").name).to eq "Random name"
source share