Sha256: 36dbdc382d94c916a7cc6ae9bfbc0821390ff4ceba10139813a7bfb8b4dbd195

Contents?: true

Size: 406 Bytes

Versions: 15

Compression:

Stored size: 406 Bytes

Contents

module RailsEdgeTest::Dsl
  class LetHandler
    attr_reader :let_blocks

    def initialize
      @let_blocks = {}
    end

    def add_definition(title, &block)
      @let_blocks[title] = block
    end

    def execute(title)
      block = @let_blocks[title]
      unless block
        fail NoMethodError, "no method or let block defined with name #{title}"
      end

      block.call
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
rails_edge_test-2.1.0 lib/rails_edge_test/dsl/let_handler.rb
rails_edge_test-2.0.0 lib/rails_edge_test/dsl/let_handler.rb
rails_edge_test-1.2.3 lib/rails_edge_test/dsl/let_handler.rb
rails_edge_test-1.2.2 lib/rails_edge_test/dsl/let_handler.rb
rails_edge_test-1.2.1 lib/rails_edge_test/dsl/let_handler.rb
rails_edge_test-1.2.0 lib/rails_edge_test/dsl/let_handler.rb
rails_edge_test-1.1.1 lib/rails_edge_test/dsl/let_handler.rb
rails_edge_test-1.1.0 lib/rails_edge_test/dsl/let_handler.rb
rails_edge_test-0.8.0 lib/rails_edge_test/dsl/let_handler.rb
rails_edge_test-1.0.0 lib/rails_edge_test/dsl/let_handler.rb
rails_edge_test-0.7.0 lib/rails_edge_test/dsl/let_handler.rb
rails_edge_test-0.6.0 lib/rails_edge_test/dsl/let_handler.rb
rails_edge_test-0.5.0 lib/rails_edge_test/dsl/let_handler.rb
rails_edge_test-0.4.0 lib/rails_edge_test/dsl/let_handler.rb
rails_edge_test-0.3.0 lib/rails_edge_test/dsl/let_handler.rb