Sha256: 8fa8d52dec63bb0fcecc920205ba30c9dc2b7e90a7ce723a16a9fae2323dc58c

Contents?: true

Size: 792 Bytes

Versions: 13

Compression:

Stored size: 792 Bytes

Contents

require 'rest-core/test'

describe RestCore::Wrapper do
  should 'wrap around simple middleware' do
    wrapper = RestCore::Bypass.dup
    wrapper.send(:include, RestCore::Wrapper)
    client = RestCore::Builder.client do
      use wrapper do
        use RestCore::Bypass
      end
      run RestCore::Dry
    end

    client.new.app.call({1=>2}).should.eq({1=>2})
  end

  should 'default app is RestCore::Dry' do
    wrapper = Class.new
    wrapper.send(:include, RestCore::Wrapper)
    wrapper.new.wrapped.class.should.eq RestCore::Dry
  end

  should 'switch default_app to RestCore::RestClient' do
    wrapper = Class.new
    wrapper.send(:include, RestCore::Wrapper)
    wrapper.default_app = RestCore::RestClient
    wrapper.new.wrapped.class.should.eq RestCore::RestClient
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rest-core-1.0.3 test/test_wrapper.rb
rest-core-1.0.2 test/test_wrapper.rb
rest-core-1.0.1 test/test_wrapper.rb
rest-core-1.0.0 test/test_wrapper.rb
rest-core-0.8.2 test/test_wrapper.rb
rest-core-0.8.1 test/test_wrapper.rb
rest-core-0.8.0 test/test_wrapper.rb
rest-core-0.7.2 test/test_wrapper.rb
rest-core-0.7.0 test/test_wrapper.rb
rest-core-0.4.0 test/test_wrapper.rb
rest-core-0.4.0.pre.2 test/test_wrapper.rb
rest-core-0.4.0.pre.1 test/test_wrapper.rb
rest-core-0.4.0.pre.0 test/test_wrapper.rb