require 'spec_helper' describe "directives" do it "executes arbitrary ruby code in a particular environment" do $env = 'staging' expect(self).to receive(:hello).exactly(1).times execute_in(env: 'staging') { hello() } execute_in(env: 'production') { hello() } end it "creates a partial" do partial("hello_partial") { hello() } expect($partials["hello_partial"][:block]).to be_kind_of(Proc) end it "executes a partial" do expect(self).to receive(:hello).with("hello").exactly(1).times partial("hello_partial") { |args| hello(args[:x]) } execute_partial "hello_partial", x: 'hello' end it "passes before and after messages" end