File: dsl_spec.rb

package info (click to toggle)
ruby-rspec-core 2.14.7-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,756 kB
  • ctags: 1,195
  • sloc: ruby: 12,708; makefile: 14
file content (25 lines) | stat: -rw-r--r-- 518 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
require 'spec_helper'

main = self

describe "The RSpec DSL" do
  methods = [
    :describe,
    :share_examples_for,
    :shared_examples_for,
    :shared_examples,
    :shared_context,
    :share_as
  ]

  methods.each do |method_name|
    describe "##{method_name}" do
      it "is not added to every object in the system" do
        expect(main).to respond_to(method_name)
        expect(Module.new).to respond_to(method_name)
        expect(Object.new).not_to respond_to(method_name)
      end
    end
  end
end