Skip to content

Instantly share code, notes, and snippets.

@flazz
Created August 6, 2012 17:35
Show Gist options
  • Select an option

  • Save flazz/3276988 to your computer and use it in GitHub Desktop.

Select an option

Save flazz/3276988 to your computer and use it in GitHub Desktop.
class SomeClass
def initialize a, b, c
@a, @b, @c = a, b, c
end
def some_method
do_something_with @a,
some_work_with @b
end
def some_other_method
something_with @a, @b
end
def yet_another
@b.act_upon @a
end
def odd_ball_method
@c.something_else @a
end
end
@flazz
Copy link
Author

flazz commented Aug 6, 2012

@b & @A are related strongly. @c, not so much.

when writing a test you'll notice that whatever mock you use for @c will be rarely considered. are that point i'd consider passing c as an argument to odd_ball_method or figuring out a different design altogether.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment