Skip to content

Instantly share code, notes, and snippets.

@r00k
Last active April 5, 2016 19:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save r00k/fb7cd343ba52369ae6fa to your computer and use it in GitHub Desktop.
Save r00k/fb7cd343ba52369ae6fa to your computer and use it in GitHub Desktop.
Quizzy Question 2

Answer to Question 1

That code violates Tell, Don't Ask..

You could also say it exhibits the feature envy smell.

(Violating Tell, Don't Ask and having feature envy are pretty much two sides of the same coin.)

Question 2

What testing code smell do we have here?

describe "#full_name" do
  it "returns a concatenated full name" do
    user = User.new
    allow(user).to receive(:first_name).and_return("John")
    allow(user).to receive(:last_name).and_return("Smith")
    
    expect(user.full_name).to eq("John Smith")
  end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment