Class: RSpec::Rails::HyperShortcut::ShortcutElements

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/rails/extra/routing/hyper_shortcut/shortcut_elements.rb

Instance Method Summary collapse

Constructor Details

#initialize(request_pair, behavior) ⇒ ShortcutElements

Returns a new instance of ShortcutElements.



3
4
5
6
# File 'lib/rspec/rails/extra/routing/hyper_shortcut/shortcut_elements.rb', line 3

def initialize(request_pair, behavior)
  @request_pair = request_pair
  @behavior = behavior
end

Instance Method Details

#descriptionObject



8
9
10
# File 'lib/rspec/rails/extra/routing/hyper_shortcut/shortcut_elements.rb', line 8

def description
  @request_pair.to_s
end

#it_blockObject



12
13
14
# File 'lib/rspec/rails/extra/routing/hyper_shortcut/shortcut_elements.rb', line 12

def it_block
  @behavior.block_to_test @request_pair.to_hash
end