Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
50 lines (35 sloc) 1.61 KB
You need a new class. Some dev on your team is *insisting* that everyone use
BDD and RSpec. You're not opposed, except that it takes so much time to
figure out where to even begin! "Write a failing spec first?" Easier said
than done.
What you really want is to write code. Plain and simple. RSpec should
facilitate that, not get in the way of it. But here you are, trying to
figure out the simplest possible thing you could possibly make this spec
fail in a way that would actually look like progress.
Enter: RFace.
How to use it:
# "Well, I know I'm going to need a method named..."
describe InterfaceExample do
include InterfaceHelper
subject {}
implements :some_instance_method, :some_other_instance_method
# InterfaceExample defines #some_instance_method, #some_other_instance_method
class_implements :some_class_method, :some_other_class_method
# InterfaceExample defines .some_class_method, .some_other_class_method
# "I'm probably going to have a simple attribute named..."
describe AssignmentExample do
include AssignmentHelper
subject {}
sets :foo => 1, :bar => 2
# Verifies that it is possible to assign or and
# that value will not change without subsequent assignment.
# "There will probably be an attribute that lives in the DB named..."
describe PersistenceExample do
include PersistenceHelper
subject {}
persists :foo => 1, :bar => 2
# Verifies that subject can be #save'd, #reload'ed, and that #foo will be 1
# between save and reload, #bar will be 2 between save and reload.