diff --git a/lib/producer/core/condition/dsl.rb b/lib/producer/core/condition/dsl.rb index 8e03b18..75b8b71 100644 --- a/lib/producer/core/condition/dsl.rb +++ b/lib/producer/core/condition/dsl.rb @@ -16,7 +16,7 @@ module Producer define_test :has_env, Tests::HasEnv define_test :has_file, Tests::HasFile - attr_reader :tests + attr_reader :block, :env, :tests def initialize(env, &block) @env = env diff --git a/spec/producer/core/condition/dsl_spec.rb b/spec/producer/core/condition/dsl_spec.rb index 1ed51d0..f61f08e 100644 --- a/spec/producer/core/condition/dsl_spec.rb +++ b/spec/producer/core/condition/dsl_spec.rb @@ -27,12 +27,12 @@ module Producer::Core end describe '#initialize' do - it 'assigns the code' do - expect(dsl.instance_eval { @block }).to be block + it 'assigns the env' do + expect(dsl.env).to be env end - it 'assigns the env' do - expect(dsl.instance_eval { @env }).to be env + it 'assigns the code' do + expect(dsl.block).to be block end it 'assigns no test' do @@ -40,13 +40,6 @@ module Producer::Core end end - describe '#tests' do - it 'returns the assigned tests' do - dsl.instance_eval { @tests = [:some_test] } - expect(dsl.tests).to eq [:some_test] - end - end - describe '#evaluate' do it 'returns the value returned by the assigned block' do expect(dsl.evaluate).to eq block.call