Class: RSpec::Core::ExampleGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/always_execute/rspec_execute.rb,
lib/always_execute/rspec_expects.rb

Class Method Summary collapse

Class Method Details

.execute(result_name = :execute_result, &execute_block) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/always_execute/rspec_execute.rb', line 30

def self.execute(result_name=:execute_result, &execute_block)
  before do
    @execute_block = execute_block
  end

  let(result_name) { @execute_result }
end

.expects(name = nil, &expects_block) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/always_execute/rspec_expects.rb', line 4

def self.expects(name = nil, &expects_block)
  describe nil do
    before do
      instance_exec(&expects_block)
    end

    it "should meet expectation #{name}" do
      # empty body
    end
  end
end