Sha256: c6d810335d11c04d49de4db3588b74f7684e7d1d13a7fba994bf5723ca1441e4

Contents?: true

Size: 1.46 KB

Versions: 52

Compression:

Stored size: 1.46 KB

Contents

describe "UIImage effects w/ CIImage & CIFilter" do
  before do
    @image = 'little_square'.uiimage
  end

  describe 'should apply a gaussian blur' do
    it 'should have a gaussian_blur method' do
      -> {
        @image.gaussian_blur.should.be.kind_of(UIImage)
      }.should.not.raise
    end
    it 'should accept a :radius option' do
      -> {
        @image.gaussian_blur(radius: 5).should.be.kind_of(UIImage)
      }.should.not.raise
    end
    it 'should accept a :radius argument in 0th position' do
      -> {
        @image.gaussian_blur(5).should.be.kind_of(UIImage)
      }.should.not.raise
    end
  end

  describe 'should apply inverted colors' do
    it 'should have inverted method' do
      -> {
        @image.inverted.should.be.kind_of(UIImage)
      }.should.not.raise
    end
  end

  describe 'should apply a darken filter' do
    it 'should have a darken method' do
      -> {
        @image.darken.should.be.kind_of(UIImage)
      }.should.not.raise
    end
    it 'should accept a :saturation option' do
      -> {
        @image.darken(saturation: 5).should.be.kind_of(UIImage)
      }.should.not.raise
    end
    it 'should accept a :brightness option' do
      -> {
        @image.darken(brightness: 5).should.be.kind_of(UIImage)
      }.should.not.raise
    end
    it 'should accept a :saturation and a :brightness option' do
      -> {
        @image.darken(saturation: 5, brightness: 5).should.be.kind_of(UIImage)
      }.should.not.raise
    end
  end

end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
sugarcube-4.0.0 spec/ios/image_uiimage_filters_spec.rb
sugarcube-3.5.0 spec/ios/image_uiimage_filters_spec.rb
sugarcube-3.4.2 spec/ios/image_uiimage_filters_spec.rb
sugarcube-3.4.1 spec/ios/image_uiimage_filters_spec.rb
sugarcube-3.4.0 spec/ios/image_uiimage_filters_spec.rb
sugarcube-3.3.7 spec/ios/image_uiimage_filters_spec.rb
sugarcube-3.3.6 spec/ios/image_uiimage_filters_spec.rb
sugarcube-3.3.5 spec/ios/image_uiimage_filters_spec.rb
sugarcube-3.3.4 spec/ios/image_uiimage_filters_spec.rb
sugarcube-3.3.3 spec/ios/image_uiimage_filters_spec.rb
sugarcube-3.3.2 spec/ios/image_uiimage_filters_spec.rb
sugarcube-3.3.1 spec/ios/image_uiimage_filters_spec.rb
sugarcube-3.3.0 spec/ios/image_uiimage_filters_spec.rb
sugarcube-3.2.0 spec/ios/image_uiimage_filters_spec.rb
sugarcube-3.1.1 spec/ios/image_uiimage_filters_spec.rb
sugarcube-3.1.0 spec/ios/image_uiimage_filters_spec.rb
sugarcube-3.0.8 spec/ios/image_uiimage_filters_spec.rb
sugarcube-3.0.7 spec/ios/image_uiimage_filters_spec.rb
sugarcube-3.0.6 spec/ios/image_uiimage_filters_spec.rb
sugarcube-3.0.5 spec/ios/image_uiimage_filters_spec.rb