Sha256: c6bb6eb63ff9c87e02ff0946797889eb92d35d7fe4843781402f6ee019875d0e

Contents?: true

Size: 843 Bytes

Versions: 14

Compression:

Stored size: 843 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
            false
          end
        end

    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
remarkable_rails-3.0.10 lib/remarkable_rails/action_controller/base.rb
remarkable_rails-3.0.3 lib/remarkable_rails/action_controller/base.rb
remarkable_rails-3.0.4 lib/remarkable_rails/action_controller/base.rb
remarkable_rails-3.0.5 lib/remarkable_rails/action_controller/base.rb
remarkable_rails-3.0.6 lib/remarkable_rails/action_controller/base.rb
remarkable_rails-3.0.2 lib/remarkable_rails/action_controller/base.rb
remarkable_rails-3.0.7 lib/remarkable_rails/action_controller/base.rb
remarkable_rails-3.0.9 lib/remarkable_rails/action_controller/base.rb
remarkable_rails-3.1.0 lib/remarkable_rails/action_controller/base.rb
remarkable_rails-3.1.1 lib/remarkable_rails/action_controller/base.rb
remarkable_rails-3.1.2 lib/remarkable_rails/action_controller/base.rb
remarkable_rails-3.1.3 lib/remarkable_rails/action_controller/base.rb
remarkable_rails-3.0.8 lib/remarkable_rails/action_controller/base.rb
remarkable_rails-3.1.4 lib/remarkable_rails/action_controller/base.rb