Sha256: 69f4294279d87fc0c5a3051884a98d4092c250dfe3c2b15e1fe0402bd2a2244a

Contents?: true

Size: 507 Bytes

Versions: 7

Compression:

Stored size: 507 Bytes

Contents

class UseLayout
  attr_reader :actual, :expected
  
  def initialize(expected)
    @expected = 'layouts/' + expected
  end

  def matches?(controller)
    @actual = controller.layout
    @actual == @expected
  end

  def failure_message
    return "use_layout expected #{@expected.inspect}, got #{@actual.inspect}"
  end

  def negeative_failure_message
    return "use_layout expected #{@expected.inspect} not to equal #{@actual.inspect}"
  end
end


def use_layout(expected)
  UseLayout.new(expected)
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
Objective3-objective_spec-0.0.4 lib/objective_spec/matchers/use_layout_matcher.rb
Objective3-objective_spec-0.1.2 lib/objective_spec/matchers/use_layout_matcher.rb
Objective3-objective_spec-0.1.3 lib/objective_spec/matchers/use_layout_matcher.rb
Objective3-objective_spec-0.1.4 lib/objective_spec/matchers/use_layout_matcher.rb
objective_spec-0.3.1 lib/objective_spec/matchers/use_layout_matcher.rb
objective_spec-0.3.0 lib/objective_spec/matchers/use_layout_matcher.rb
objective_spec-0.2.0 lib/objective_spec/matchers/use_layout_matcher.rb