Sha256: 9659149c9925ee57e0685126e4c2de7e1a7e748550fb6d5784257a9ad013e61d

Contents?: true

Size: 1.08 KB

Versions: 8

Compression:

Stored size: 1.08 KB

Contents

require 'rest-core/test'

describe RC::Builder do
  would 'default client app is a kind of RestCore::Engine' do
    RC::Builder.client.new.app.should.kind_of? RC::Engine
  end

  would 'default        app is a kind of RestCore::Engine' do
    RC::Builder.new.to_app.should.kind_of? RC::Engine
  end

  would 'switch default_engine to RestCore::Dry a' do
    builder = Class.new(RC::Builder)
    builder.default_engine = RC::Dry
    builder.new.to_app.class.should.eq RC::Dry
  end

  would 'switch default_engine to RestCore::Dry b' do
    builder = RC::Builder.dup
    builder.default_engine = RC::Dry
    builder.client.new.app.class.should.eq RC::Dry
  end

  would 'accept middleware without a member' do
    RC::Builder.client{
      use Class.new.send(:include, RC::Middleware)
    }.members.should.eq [:config_engine]
  end

  would 'not have duplicated fields' do
    middleware = Class.new do
      def self.members; [:value]; end
      include RC::Middleware
    end
    client = RC::Builder.client(:value){ use middleware }.new
    client.value = 10
    client.value.should.eq 10
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rest-core-3.6.0 test/test_builder.rb
rest-core-3.5.92 test/test_builder.rb
rest-core-3.5.91 test/test_builder.rb
rest-core-3.5.9 test/test_builder.rb
rest-core-3.5.8 test/test_builder.rb
rest-core-3.5.7 test/test_builder.rb
rest-core-3.5.6 test/test_builder.rb
rest-core-3.5.5 test/test_builder.rb