Sha256: f253a3a8bbb0838c45c9523d1a74e7f5425cca6e3b3ba655a19680247c3de82f

Contents?: true

Size: 811 Bytes

Versions: 9

Compression:

Stored size: 811 Bytes

Contents

module Remarkable
  module ActionController
    class Base < Remarkable::Base

      before_assert :perform_action_with_macro_stubs

      optional :with_expectations, :default => true
      optional :with_stubs,        :default => true

      protected

        # Before assertions, call run_action! to perform the action if it was
        # not performed yet.
        #
        def perform_action_with_macro_stubs #:nodoc:
          @spec.send(:run_action!, run_with_expectations?) if @spec.send(:controller)
        end

        def run_with_expectations? #:nodoc:
          if @options.key?(:with_stubs)
            !@options[:with_stubs]
          elsif @options.key?(:with_expectations)
            @options[:with_expectations]
          else
            true
          end
        end

    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
benhutton-remarkable_rails-4.0.0.alpha7 lib/remarkable_rails/action_controller/base.rb
benhutton-remarkable_rails-4.0.0.alpha6 lib/remarkable_rails/action_controller/base.rb
benhutton-remarkable_rails-4.0.0.alpha5 lib/remarkable_rails/action_controller/base.rb
benhutton-remarkable_rails-4.0.0.alpha4 lib/remarkable_rails/action_controller/base.rb
remarkable_rails-3.1.13 lib/remarkable_rails/action_controller/base.rb
remarkable_rails-3.1.12 lib/remarkable_rails/action_controller/base.rb
remarkable_rails-3.1.11 lib/remarkable_rails/action_controller/base.rb
remarkable_rails-3.1.10 lib/remarkable_rails/action_controller/base.rb
remarkable_rails-3.1.9 lib/remarkable_rails/action_controller/base.rb