Sha256: 211776f6cb655747cc52c35d9c80a6e7d8c7c24a1ba8d482b62a04c88cf6cf6b

Contents?: true

Size: 1.25 KB

Versions: 5

Compression:

Stored size: 1.25 KB

Contents

require 'spec_helper'

describe RSpec do
  describe "::configuration" do
    it "returns the same object every time" do
      expect(RSpec.configuration).to equal(RSpec.configuration)
    end
  end

  describe "::configuration=" do
    it "sets the configuration object" do
      configuration = RSpec::Core::Configuration.new

      RSpec.configuration = configuration

      expect(RSpec.configuration).to equal(configuration)
    end
  end

  describe "::configure" do
    it "yields the current configuration" do
      RSpec.configure do |config|
        expect(config).to equal(RSpec::configuration)
      end
    end
  end

  describe "::world" do
    it "returns the same object every time" do
      expect(RSpec.world).to equal(RSpec.world)
    end
  end

  describe "::world=" do
    it "sets the world object" do
      world = RSpec::Core::World.new

      RSpec.world = world

      expect(RSpec.world).to equal(world)
    end
  end

  describe "::reset" do
    it "resets the configuration and world objects" do
      config_before_reset = RSpec.configuration
      world_before_reset  = RSpec.world

      RSpec.reset

      expect(RSpec.configuration).not_to equal(config_before_reset)
      expect(RSpec.world).not_to equal(world_before_reset)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rspec-core-2.14.3 spec/rspec/core_spec.rb
rspec-core-2.14.2 spec/rspec/core_spec.rb
rspec-core-2.14.1 spec/rspec/core_spec.rb
rspec-core-2.14.0 spec/rspec/core_spec.rb
rspec-core-2.14.0.rc1 spec/rspec/core_spec.rb