Skip to content

Instantly share code, notes, and snippets.

@sourcerebels
Created March 5, 2012 16:31
Show Gist options
  • Save sourcerebels/1979142 to your computer and use it in GitHub Desktop.
Save sourcerebels/1979142 to your computer and use it in GitHub Desktop.
BDD > Ruby > RSpec Specification Sample
class Test
def initialize(value)
@value = value
end
def reverse
@value = @value.reverse!
end
def value
@value
end
end
require "test"
describe Test, '#reverse' do
it "should reverse a string" do
test = Test.new "sourcerebels"
test.reverse
test.value.should eq("sleberecruos")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment