Class: RSpec::Rails::HyperShortcut::SubjectPlaceholder

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

Instance Method Summary collapse

Constructor Details

#initialize(group, request_pair) ⇒ SubjectPlaceholder

Returns a new instance of SubjectPlaceholder.



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

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

Instance Method Details

#describe_my(behavior) ⇒ Object



18
19
20
21
# File 'lib/rspec/rails/extra/routing/hyper_shortcut/subject_placeholder.rb', line 18

def describe_my(behavior)
  shortcut_elements = ShortcutElements.new @request_pair, behavior
  describe_from(shortcut_elements)
end

#should(matcher_placeholder) ⇒ Object



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

def should(matcher_placeholder)
  behavior = Behavior.new :should, matcher_placeholder
  describe_my behavior
end

#should_not(matcher_placeholder) ⇒ Object



13
14
15
16
# File 'lib/rspec/rails/extra/routing/hyper_shortcut/subject_placeholder.rb', line 13

def should_not(matcher_placeholder)
  behavior = Behavior.new :should_not, matcher_placeholder
  describe_my behavior
end