spec/polytrix/validator_registry_spec.rb in polytrix-0.1.0 vs spec/polytrix/validator_registry_spec.rb in polytrix-0.1.1
- old
+ new
@@ -3,14 +3,15 @@
subject(:registry) { Polytrix::ValidatorRegistry }
describe '#register' do
it 'registers a validator' do
callback = proc do |challenge|
+ expect(challenge[:result]).to_not be_nil
expect(challenge[:result].execution_result.exitstatus).to eq(0)
end
expect(registry.validators).to be_empty
- registry.register suite: 'java', sample: 'hello world', &callback
+ registry.register(Validator.new('dummy', suite: 'java', sample: 'hello world', &callback))
validator = registry.validators.first
expect(validator.suite).to eql('java')
expect(validator.sample).to eql('hello world')
expect(validator.instance_variable_get('@callback')).to eql(callback)
end