Sha256: 23af805a402514538f9af813380a3f9be3c5631157d803049ccb3526a6b68123

Contents?: true

Size: 497 Bytes

Versions: 18

Compression:

Stored size: 497 Bytes

Contents

require 'test_helper'

class ShortcutContext
  extend Surrounded::Context
  shortcut_triggers
  
  initialize :user, :other
  
  trigger :shorty do
    user.speak
  end
  
  role :user do
    def speak
      'it works, shorty!'
    end
  end
end

describe Surrounded::Context, 'shortcuts' do
  let(:user){ User.new("Jim") }
  let(:other){ User.new("Guille") }
  it 'creates shortcut class methods for triggers' do
    assert_equal 'it works, shorty!', ShortcutContext.shorty(user, other)
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
surrounded-0.9.11 test/context_shortcuts_test.rb
surrounded-0.9.10 test/context_shortcuts_test.rb
surrounded-0.9.9 test/context_shortcuts_test.rb
surrounded-0.9.8 test/context_shortcuts_test.rb
surrounded-0.9.7 test/context_shortcuts_test.rb
surrounded-0.9.6 test/context_shortcuts_test.rb
surrounded-0.9.5 test/context_shortcuts_test.rb
surrounded-0.9.4 test/context_shortcuts_test.rb
surrounded-0.9.3 test/context_shortcuts_test.rb
surrounded-0.9.2 test/context_shortcuts_test.rb
surrounded-0.9.1 test/context_shortcuts_test.rb
surrounded-0.9.0 test/context_shortcuts_test.rb
surrounded-0.8.4 test/context_shortcuts_test.rb
surrounded-0.8.3 test/context_shortcuts_test.rb
surrounded-0.8.2 test/context_shortcuts_test.rb
surrounded-0.8.1 test/context_shortcuts_test.rb
surrounded-0.8.0 test/context_shortcuts_test.rb
surrounded-0.7.3 test/context_shortcuts_test.rb