Class: Juxtapose::FrankStrategy
- Inherits:
-
Object
- Object
- Juxtapose::FrankStrategy
- Defined in:
- lib/juxtapose/strategy/frank_strategy.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
Class Method Summary collapse
Instance Method Summary collapse
- #current_spec_description ⇒ Object
- #device_name ⇒ Object
-
#initialize(context) ⇒ FrankStrategy
constructor
A new instance of FrankStrategy.
- #save_current(filename) ⇒ Object
- #spec_dir ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(context) ⇒ FrankStrategy
Returns a new instance of FrankStrategy.
8 9 10 |
# File 'lib/juxtapose/strategy/frank_strategy.rb', line 8 def initialize(context) self.context = context end |
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
7 8 9 |
# File 'lib/juxtapose/strategy/frank_strategy.rb', line 7 def context @context end |
Class Method Details
.setup ⇒ Object
3 4 5 |
# File 'lib/juxtapose/strategy/frank_strategy.rb', line 3 def self.setup Cucumber::RbSupport::RbDsl.register_rb_hook('before', [], Proc.new {|scenario, block| @__scenario = scenario }) end |
Instance Method Details
#current_spec_description ⇒ Object
16 17 18 |
# File 'lib/juxtapose/strategy/frank_strategy.rb', line 16 def current_spec_description context.instance_variable_get('@__scenario').name end |
#device_name ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/juxtapose/strategy/frank_strategy.rb', line 20 def device_name screen_type = '' name = [context.version] if context.version == 'iphone' name << 'retina' if width > 320 name << '5' if height > 960 else name << 'retina' if width > 768 end name.join('-') end |
#save_current(filename) ⇒ Object
33 34 35 |
# File 'lib/juxtapose/strategy/frank_strategy.rb', line 33 def save_current(filename) context.frankly_screenshot(filename, nil, false) end |
#spec_dir ⇒ Object
37 38 39 |
# File 'lib/juxtapose/strategy/frank_strategy.rb', line 37 def spec_dir "features/screens" end |
#version ⇒ Object
12 13 14 |
# File 'lib/juxtapose/strategy/frank_strategy.rb', line 12 def version @version ||= "ios_#{context.app_exec("ios_version").first}" end |