Sha256: 3063967af6d8285ff9aa8a81f2ba2f3147ccdb5562f7a27179ad5cb929a021d3
Contents?: true
Size: 1.74 KB
Versions: 1
Compression:
Stored size: 1.74 KB
Contents
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe Remarkable::DSL::Assertions do subject { [1, 2, 3] } before(:each) do @matcher = Remarkable::Specs::Matchers::CollectionContainMatcher.new(1, 2, 3) end it 'should provide default structure for assertions' do should collection_contain(1) should collection_contain(1, 2) should collection_contain(1, 2, 3) should_not collection_contain(4) should_not collection_contain(1, 4) end it 'should provide default structure for single assertions' do should single_contain(1) should_not single_contain(4) nil.should_not single_contain(1) end it 'should provide collection in description' do @matcher.description.should == 'contain 1, 2, and 3' end it 'should provide value to expectation messages' do @matcher.matches?([4]) @matcher.failure_message.should == 'Expected that 1 is included in [4]' end it 'should accept blocks as argument' do should_not single_contain(4) should single_contain(4){ self << 4 } end it 'should provide an interface for default_options hook' do matcher = Remarkable::Specs::Matchers::CollectionContainMatcher.new(1, :args => true) matcher.instance_variable_get('@options').should == { :working => true, :args => true } end it 'should provide an interface for after_initialize hook' do matcher = Remarkable::Specs::Matchers::CollectionContainMatcher.new(1) matcher.instance_variable_get('@after_initialize').should be_true end it 'should provide an interface for before_assert hook' do matcher = Remarkable::Specs::Matchers::CollectionContainMatcher.new(1) [1, 2, 3].should matcher matcher.instance_variable_get('@before_assert').should be_true end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
remarkable-3.1.9 | spec/dsl/assertions_spec.rb |