Spacerobots:

  • Archive
  • RSS
  • Ask me anything

Spinach

Spinach, a gherkin based test framework like cucumber but without the Regex madness.

https://github.com/codegram/spinach

    • #testing
    • #spinach
    • #cucumber
    • #ruby
    • #tdd
    • #bdd
  • 7 months ago
  • 6
  • Permalink
  • Share
    Tweet

Scope a variable and clean up your code with .tap

Great case for using .tap to clean up and organize code.

Example

<div class="active_messages">
  <% @active_messages.each do |message| %>
    <h1><%= message.title %></h1>
    <div class="latest_comment">
      <% message.comments.last.tap do |comment| %>
        <div class="avatar">
          <%= avatar_for(comment.creator) %>
        </div>
        Latest comment <%= time_ago_in_words(comment.created_at) %> ago by <%=    comment.creator.full_name %>
      <% end %>
    </div>
  <% end %>
</div>
    • #ruby
  • 2 years ago
  • Permalink
  • Share
    Tweet

About






A place for me (Matt Petty aka lodestone) to stream and splay stuff. I'm an entrepreneur and ruby developer with a love of life, great fiction (mostly the science or fantasy variety), and drink.


Follow/Stalk me:
  • Forrst
  • Twitter
  • Facebook
  • Working w/ Rails

Also, I like words

Twitter

loading tweets…

  • RSS
  • Random
  • Archive
  • Ask me anything
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr