Top Level Namespace

Includes:
Spec::DSL::Main

Defined Under Namespace

Modules: ActionController, ActionView, ActiveRecord, ActiveRecordExtensions, ActiveSupport, AdditionHelper, ApplicationHelper, ArticlesHelper, AssertSelectSpecHelpers, Bug11223, Bug719, Bug7611, Bug7805, Bug8302, BugReport496, BugReport600, Custom, ExampleExpectations, ExplicitHelper, Foo, HelperMacros, HelperMethodExample, HelperMethods, HomeHelper, Hubbub, Kernel, LoginsHelper, Macros, MoreExplicitHelper, OpenID, OpenIdAuthentication, PagesHelper, Postable, RCov, Rails, Resourceful, RubyForker, Spec, TagsHelper, Test, TestUnitSpecHelper, ViewSpecHelper, WarpDrive Classes: ActionViewBaseSpecController, AddOpenIdAuthenticationTables, Animal, ApplicationController, Array, Article, ArticlesController, AssertSelectController, AssertSelectMailer, AssociatedModel, ControllerInheritingFromApplicationControllerController, ControllerSpecController, CookiesProxyExamplesController, CreateArticles, CreatePages, CreateTaggings, CreateTags, CreateUsers, CustomRouteSpecController, FakeReporter, HomeController, IntegrationSpecGenerator, LiarLiarPantsOnFire, LineNumberQuerySubject, MockableModel, NormalizeTest, Object, OpenIdAuthenticationTablesGenerator, OpenIdAuthenticationTest, Page, PagesController, Person, PostableTest, Proc, RedirectSpecController, RenderSpecController, ResourcefulScaffoldGenerator, RjsSpecController, RspecCommandError, RspecControllerGenerator, RspecGenerator, RspecModelGenerator, RspecOnRailsSpecsController, RspecScaffoldGenerator, RspecWorld, SomethingExpected, StatusTest, SubMockableModel, Substance, SubstanceTester, Tag, Tagging, TagsController, TestCaseThatFails, TestCaseThatPasses, TestCaseWithErrors, TestUnitTesting, Thing, UnsortableObject, UpgradeOpenIdAuthenticationTablesGenerator, User, UserSession, UserSessionsController, ValidationReflectionTest

Constant Summary collapse

RAILS_ROOT =
File.dirname(__FILE__)
SpecFailed =
Spec::Expectations::ExpectationNotMetError

Instance Method Summary collapse

Methods included from Spec::DSL::Main

#describe, #share_as, #share_examples_for

Methods included from Spec::Example::ArgsAndOptions

#add_options, #args_and_options, #set_location

Instance Method Details

#failObject



38
39
40
# File 'lib/vendor/plugins/rspec-rails/spec/spec_helper.rb', line 38

def fail()
  raise_error(Spec::Expectations::ExpectationNotMetError)
end

#fail_with(message) ⇒ Object



42
43
44
# File 'lib/vendor/plugins/rspec-rails/spec/spec_helper.rb', line 42

def fail_with(message)
  raise_error(Spec::Expectations::ExpectationNotMetError,message)
end

#jruby?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/vendor/plugins/rspec/spec/spec_helper.rb', line 13

def jruby?
  ::RUBY_PLATFORM == 'java'
end

#with_sandboxed_configObject



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/vendor/plugins/rspec/spec/spec_helper.rb', line 66

def with_sandboxed_config
  attr_reader :config
  
  before(:each) do
    @config = ::Spec::Runner::Configuration.new
    @original_configuration = ::Spec::Runner.configuration
    spec_configuration = @config
    ::Spec::Runner.instance_eval {@configuration = spec_configuration}
  end
  
  after(:each) do
    original_configuration = @original_configuration
    ::Spec::Runner.instance_eval {@configuration = original_configuration}
    ::Spec::Example::ExampleGroupFactory.reset
  end
  
  yield
end

#with_sandboxed_optionsObject



51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/vendor/plugins/rspec/spec/spec_helper.rb', line 51

def with_sandboxed_options
  attr_reader :options
  
  before(:each) do
    @original_rspec_options = ::Spec::Runner.options
    ::Spec::Runner.use(@options = ::Spec::Runner::Options.new(StringIO.new, StringIO.new))
  end

  after(:each) do
    ::Spec::Runner.use(@original_rspec_options)
  end
  
  yield
end